On my development board, I am trying to make 8 LEDs (0 - 7) blink one by one.
Here, is my code. What do I need to change to get my desired output, Please help.
int main (void)
{
int a,b;
DDRC = 0xFF;
PORTC = 0xFF;
num = PORTC;
for (;;)
{
for (a=1;a<=8;a++)
{
num = num >> a;
for (b=0;b<4;b++)
{
PORTC = num;
num = num | 0xFF;
delay();
}
num = 0xFF;
}
PORTC = 0xFF;
}
return;
}
void delay()
{
unsigned char i,j,k;
for (i=0;i<255;i++)
{
for (j=0;j<255;j++)
{
for (k=0;k<109;k++)
{
;
}
}
}
return ;
}