You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The solution is to use "unsigned long" for all variables in the equation that checks the elapsed time against the wanted expiry time (if (current_millis - prev_millis[i] >= delays[i]) {).
So delays must also be unsigned long. See also: http://playground.arduino.cc/Code/TimingRollover.
After 49 days of running, millis() wraps and SimpleTimer logic will be broken (will fire at wrong time).
Check for this condition is needed.
for example:
if:
prev_millis[0] == 4,294,967,290 (just 5 mills from wrap over)
current_millis == 1 (just after wrap over)
"if" statement above will be satisfied for almost any delays[0] value.
this will lead to timer being fired pre-maturely
The text was updated successfully, but these errors were encountered: