Hello
here is c program for LED blinking. I have tested this code
I don't understand this part of code
I understand j is variable. how does this part of code work on microcontroller ?
here is c program for LED blinking. I have tested this code
Code:
#include<regx51.h>
#define LED P2
#define LED_ON 0xff
#define LED_OFF 0x00
void delay (unsigned int i)
{
unsigned int j;
for (j = 0; j < 40000; j++);
{
}
}
void main()
{
while (1)
{
LED = LED_ON;
delay(500);
LED = LED_OFF;
delay(5000);
LED = LED_OFF;
}
}
Code:
void delay (unsigned int i)
{
unsigned int j;
for (j = 0; j < 40000; j++);
{
}