Write a program to glow last 4 LEDs of 1st group of LEDs and to glow first 4 LEDs of 2nd group of LEDs simultaneously and after 1 second to glow first 4 LEDs of 1st group of LEDs and to glow last 4 LEDs of 2nd group of LEDs simultaneously and it should be repeated infinitely.


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

Add Comment