To reset or not to reset? millis rollover is the question

Happily... he is wrong. If you use the method shown above then even when millis() rolls over the comparison with the previous snapshot taken still produces the correct result. Go have a look at how unsigned subtraction arithmetic works.

1 Like