I am using the millis function and I have a question.
"Returns the number of milliseconds passed from the start-up of the module"
Where is this value stored? What is its limit? That is, is it reset to zero after 1 day, when reaching a limit value or how?
Thanks.
Millis function
- Fernando Perez
- Posts: 378
- Joined: Mon Feb 15, 2021 10:09 pm
- Location: Santander (Spain)
- Has thanked: 195 times
- Been thanked: 267 times
- PeterN
- Posts: 366
- Joined: Mon Feb 08, 2021 7:56 pm
- Location: Krefeld, Germany
- Has thanked: 171 times
- Been thanked: 203 times
- Contact:
Re: Millis function
Hi Fernando
I guess that the rules of the Arduino environment apply here ...
----------
millis()
[Time]
Description
Returns the number of milliseconds passed since the Arduino board began running the current program. This number will overflow (go back to zero), after approximately 50 days.
...
Returns
Number of milliseconds passed since the program started. Data type: unsigned long.
-----------
The 32bit unsigned value then ends up in ANNEX in a 32bit integer variable, so it should still reflect the mentioned 50 days and then starts again at 0
I guess that the rules of the Arduino environment apply here ...
----------
millis()
[Time]
Description
Returns the number of milliseconds passed since the Arduino board began running the current program. This number will overflow (go back to zero), after approximately 50 days.
...
Returns
Number of milliseconds passed since the program started. Data type: unsigned long.
-----------
The 32bit unsigned value then ends up in ANNEX in a 32bit integer variable, so it should still reflect the mentioned 50 days and then starts again at 0
- cicciocb
- Site Admin
- Posts: 1899
- Joined: Mon Feb 03, 2020 1:15 pm
- Location: Toulouse
- Has thanked: 407 times
- Been thanked: 1269 times
- Contact:
- Fernando Perez
- Posts: 378
- Joined: Mon Feb 15, 2021 10:09 pm
- Location: Santander (Spain)
- Has thanked: 195 times
- Been thanked: 267 times
Re: Millis function
Thank you both very much. If so, I can use it without problems in the project in which I work that will use periods of 31 days maximum.