#include<LPC21XX.h>
#define led 0X0000AA00
void delay();
main()
{
PINSEL0=0X00000000;
//port0
IODIR0=0X0000FF00;//make the pins from P0.8 - P0.15 as outputs
while(1)
{
if(!(IOPIN0&(1<<16))) /*check the status of the switch if low start
blinking*/
{
IOSET0=led;
delay();
IOCLR0=0X0000FF00;
delay();
}
else
IOCLR0=0X0000FF00;
}
}
void delay()
{
int i,j;
for(i=0;i<1000;i++)
{
for(j=0;j<500;j++);
}
}
note the if condition inorder to check the status of a pin use '&' for
AND operation not '&&' and use
1 or (1<<0) or 0x00000001
2 or (1<<1) or 0x00000002
4 or (1<<2) or 0x00000004
for checking the pins in 0th,1st,2nd,....
On Dec 25, 10:18 am, santhosh santhosh <thos...@yahoo.com> wrote:
> I need PIC16F877A circuit with program example with compiler name
>
check this one http://hypernuclide.com/viewtopic.php?f=36&t=75
On Dec 25, 10:18 am, santhosh santhosh <thos...@yahoo.com> wrote:
> I need PIC16F877A circuit with program example with compiler name
>
next u request anything which is off the topic create your own post!
here u go :- http://groups.google.com/group/hypernuclide/browse_thread/thread/26778e918f9ac710