I am confused as to whether millis() resets after 9.5 hrs or 48.5 days.
this pages says 50 days:
The Arduino programming language Reference, organized into Functions, Variable and Constant, and Structure keywords.
Here, says millis resets after 9h32m, but timer0_overflow_count goes to 48.5days, along with a bunch of other stuff I don't understand
http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1167861718
Here, says 9 hrs
http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1200662708
Here, also:
http://www.faludi.com/2007/12/18/arduino-millis-rollover-handling/
Which is it? - Arduino deumilanove ATMEGA 328
Thanks!
Right, that's the one I referenced first in my links, as part of the thing that's causing my confusion. Or, by posting that, were you inferring that the answer on that page (50 days) is the correct answer?
Thanks.
Option B...
Or, by posting that, were you inferring that the answer on that page (50 days) is the correct answer?
millis wraps at 0xFFFFFFFF milliseconds which comes out to...
0xFFFFFFFF / 1000 / 60 / 60 / 24 = 49.7102696 days.
And, if you do everything correctly, you don't ever need to worry about it wrapping.
westfw
January 7, 2011, 4:27am
5
millis() USED to have a bug that caused it to have wrap-related problems after 9.5 hours, but they were fixed "a long time ago."
Ah, ok. Thanks for clearing that up.