AndrewMascolo / CountUpDownTimer

MIT License
28 stars 20 forks source link

CountDown stops working for any time value between 4335 and 3721 seconds #6

Closed jhwang107 closed 8 years ago

jhwang107 commented 8 years ago

Timer will stop to countdown for any timer value between 4335 and 3721 (inclusive)

here is the short sample code I used to verify this issue, timer refuses to countdown.

include

CountUpDownTimer T(DOWN);

void setup() { Serial.begin(115200); T.SetTimer(4335); T.StartTimer(); }

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.print(T.ShowSeconds()); Serial.print(":"); Serial.print(T.ShowMilliSeconds()); Serial.print(":"); Serial.println(T.ShowMicroSeconds()); } }

jhwang107 commented 8 years ago

sorry... I saw the other post from jiloc and implemented the change:

now the issue is fixed. not sure what's so special about numbers between 4335 and 3721...

excellent work by the way. saves me from keeping track of bunch of ugly millis().