-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
elapsedSeconds doesn't seem to be rollover-safe. #16
Comments
Fixes #16 by using modular arithmetic.
I've not tested it yet, but #17 should resolve this. |
#17 does a The millis() rollover at 0xFFFFFFFF makes the seconds rollover happen with the change from
gives these numbers:
It seems complicated to handle seconds as millis()/1000. Maybe the methods would work better with elapsedSeconds base number as ms? For example:
|
Fixes #16 by using modular arithmetic.
Since elapsedSeconds uses millis()/1000, I was curious about how it handles rollover so I took the example and reset the timer0_millis:
This code blinks the elapsedSeconds LEDs a couple times, and then they stick on.
Wokwi simulation:
https://wokwi.com/projects/402859003988453377
The text was updated successfully, but these errors were encountered: