Write a program to glow only last 4 LEDs and after 1 second only first 4 LEDs should glow and it should be repeated infinitely.


#include<8051.h>
void delay(unsigned int i)
{
while(i!=0)
{
i–;
}
}
void main()
{
while(1)
{
P0=0x0f;
delay(50000);
P0=0xf0;
delay(50000);
}
}

Add Comment