-->

LED Blinking By using 8051 in Keil IDE

By
sbit LED1 = P2^0;  // P2.0 of the pin name cahnged to LED1
void delay();    // a delayis used  to give some delay in between turn ON  and OFF  

void main()
{
  while(1)
  {
  
 LED1 = 0;
 
 delay();

 LED1 = 1 ;
 delay();
 
   }
}

 void delay()
 {
   int j;
     
    for(j=0; j<500; j++)
    ;
 }

More Posts

gElectron. Powered by Blogger.