.I got my first microcontroller programmer for 8051. I am trying to blink eight LED's.
I wrote program to blink all LED's
My program
But only one led is blinking P2.7 and remaining is ON. I cross checked all the connections and found that connections are correct
What is wrong, please help me
I wrote program to blink all LED's
My program
Code:
#include <REG51.h>
sbit LED_Port = P2; // All LED's connected to port P2
void Delay (unsigned int loop);
void main(void)
{
LED_Port = 0x000000; // All LED's OFF
while (1)
{
LED_Port = 0x11111111; // Turn ON All LED's
Delay(60000); // Wait 60 ms
LED_Port = 0x00000000; // turn off All LED's
Delay(30000); // wait 30ms
}
}
void Delay (unsigned int loop) // Delay function
{
unsigned int i;
for (i = 0; i <loop; i++);
{
}
}
What is wrong, please help me
Attachments
-
173.9 KB Views: 5