I'm tearing my hair out over a simple for loop!
Why does this code work:
And this code not work?
The only change is the direction of the loop, up or down.
Why does this code work:
Code:
void clsLCD(void)
{ // Erase the LCD DDRAM and set cursor home (0,0)
char line;
for (line=0; line<6; line++) // 6 lines of LCD DDRAM
{clLLCD(line);} // Erase each in turn
}
Code:
void clsLCD(void)
{ // Erase the LCD DDRAM and set cursor home (0,0)
char line;
for (line=5; line>=0; line--) // 6 lines of LCD DDRAM
{clLLCD(line);} // Erase each in turn
}
Comment