Timeline for Is an Arduino capable of running 24/7?
Current License: CC BY-SA 3.0
10 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Mar 18, 2016 at 16:48 | comment | added | Michael |
Even if one doesn't use millis directly, I wonder whether one can be confident that neither of the imported libraries does.
|
|
| Jul 2, 2015 at 22:50 | comment | added | Nick Gammon♦ | The millis() overflow never has to be a problem. See millis() overflow ... a bad thing? for more details. Basically if you calculate time intervals by subtraction, using the appropriate data types, you will never have an issue. | |
| Sep 18, 2014 at 7:38 | comment | added | Memet Olsen | To be more precise, the overflow happens after 49 days, 17 hours, 2 minutes, 47 seconds and 295 milliseconds. | |
| Apr 4, 2014 at 10:14 | comment | added | Lesto | if you do millis()-startTime (with start time as a unsigned long, aka uint32_t), you'll always get a valid result unless more than one overflow is happened | |
| Apr 4, 2014 at 7:03 | comment | added | EternityForest | A lot of the time, mills() rollover isn't really a problem because people tend to use millis() is a relative way. They will take the difference between two millis() calls, or they will take a start time, and check if millis() is greater than start+Time. Arithmetic rollover and millis() rollover often cancel out such that time2-time1 is accurate even if there is a rollover between them, as long as there isn't two rollovers. Often if your code uses absolute millis() values it can be refactored to use relative millis() logic. | |
| Feb 15, 2014 at 5:29 | comment | added | 80HD | Then all you have to do is use another uint32_t that increments when the first rolls over. Then you can enjoy roughly 5.846×10^8 years between rollovers. | |
| Feb 12, 2014 at 7:10 | comment | added | Connor Wolf |
To be precise, millis is a uint32_t variable, so it will overflow ("go back to zero") in 4294967296 milliseconds, which is ~49.7 days, ~1193 hours or ~71582 minutes.
|
|
| Feb 12, 2014 at 1:39 | vote | accept | Butzke | ||
| Feb 11, 2014 at 22:53 | review | First posts | |||
| Mar 13, 2014 at 22:37 | |||||
| Feb 11, 2014 at 22:36 | history | answered | sachleen | CC BY-SA 3.0 |