lcd.print("Press B1 or i'll ");
lcd.setCursor(0,1);
lcd.print("call help : ");
int i=60;
for(int i=60; i > 0; i--)
{
lcd.setCursor(13,1);
lcd.print(i);
delay(1000);
if (i==0) break;
}
}
the purpose is to display the seconds from 60 to zero and if no reponse of button is pressed (i havent written that code here) it calls for help
now, when the counter goes to zero in my program, intead of restarting again (since it is in the loop() function) and basically counting back wards from 60 again, it instead starts printing in the lcd :
90, 80, then 70 ... 10 then
starts from 60 counting backwards, and it also displays the character 'r' in the LCD (i didnt include that)
i thought that was weird
thats why i put the command int i=60;
to ensure that when the program restarts the loop(), the variable is given the value 60
still, the behaviour of the program is the same
now the counter it goes down normally, until it reaches ten
in that moment it prints to the lcd
10
90
80
70
.
.
.
90
80
70
60
50
40
30
20
10
then starts again from 60 as normal, and the extra character is removed magically....until it appears again
so YES, it is a leading zero problem.
how do i remove that goddamn zero?
UPDATE: The extra character is basically a whole extra string. It rewrites the lcd print text, omitting the first letter only which is "P".
This behavior is removed when i call lcd.clear() at the start of the loop, but why is this behaviour happening in the first place?
except i dont know why these two errors occured.. the leading zero and the redisplay of the string (with the first character omitted), whe i dont write a lcd.clear() funtction at the start of the loop