Skip to main content
7 of 9
deleted 16 characters in body
Juraj
  • 18.2k
  • 4
  • 30
  • 49

It is not a property of millis(). Every counter with limited number of digits once returns to zeros. For example a 4 digits tally counter returns to zeros after 9999.

Under the hood the variable for millis() is of type unsigned long which is 32 bits on the Arduino. Here the 32 bits are the digits of the tally counter. With only two digits of binary 0 and 1. The maximum is 11111111 11111111 11111111 11111111. After then it returns to zeros if adding 1. The 32 ones is 2^32 - 1, or 4294967295 in decimal. The maximum value for the counter is then 4294967295 milliseconds. Converted to days you get approximately 49.71 days.

tally couter

Juraj
  • 18.2k
  • 4
  • 30
  • 49