Forum Controladores/PLC

Welcome!

This community is for professionals and enthusiasts of our products and services. Share and discuss the best content and new marketing ideas, build your professional profile and become a better marketer together.

0

Counter with millis() function

Avatar
Guest

Dear Industrial Shields team, 


which is the maximum value that the millis() function can hold on a counter? 


Thank you,

Avatar
Descartar
1 Respuesta
0
Avatar
Support Team
Best Answer

Hi there!


Using Millis() function the variable that returns is a 32-bit positive integer (uint32_t).

The maximum number available is about 4E + 9 milliseconds = 4E + 6 seconds = 71E + 3 minutes = 1200 hours = 49.7 days.

When this time has elapsed, start again from 0.


You can get more information related with Millis() library at the following link to our blog: 

https://www.industrialshields.com/blog/arduino-industrial-1/post/industrial-arduino-millis-vs-delay-248


Cheers!

Avatar
Descartar