I'm trying to add a count up timer to my project. So far I have been able to figure out the countupdowntimer library and have been able to set it to count up from 00:00:00.
start and stop the timer with a pushbutton and reset with a pushbutton.
But like the comments in the library say after it hits :59 seconds it dosnt change to 00. The 9 stays in the second decimal spot. and it displays 19,29,39,49,59,69,79,89,99 then goes back to 10,11 and gets back to the normal up counting of seconds It says to use sprintf to fix this problem but I have found no info on how to do this with an LCD display.
I tried to cheat and use an "IF" statement to correct it by blanking out the second digit but it didn't work
is there a simple way to fix this
thanks for the help
void loop()
{
T.Timer(); // run the timer
if (T.TimeHasChanged() ) // this prevents the time from being constantly shown.
{
Serial.print(T.ShowHours());
Serial.print(":");
Serial.print(T.ShowMinutes());
Serial.print(":");
Serial.println(T.ShowSeconds());
lcd.setCursor(0, 0);
lcd.print(T.ShowHours());
lcd.print(":");
lcd.print(T.ShowMinutes());
lcd.print(":");
lcd.print(T.ShowSeconds());
// This DOES NOT format the time to 0:0x when seconds is less than 10.
// if you need to format the time to standard format, use the sprintf() function.
}
if
(T.ShowSeconds()>59)
{lcd.setCursor(5,0);
lcd.print(" ");
}
}