Millis () function overflow in Tinygps library

I have been making a GPS device for about a year without restarting. I am using the library TinyGPS+. I noticed that the library has functions millis(). Thus, they can overflow. Is there any way to avoid this?

+3
source share
2 answers

But you need to know the time since the program started or only the intervals.

unsigned long start = millis();
...
// Long running actions....
...
unsigned long stop = millis();
unsigned long interval = stop-start;

This will still work until the beginning and end are separated by 49 days. I doubt that you need to count the interval from the beginning of the program until the counter overflows.

See also here: http://forum.arduino.cc/index.php?topic=122413.0

+1
source

millis() int , , reset , arduino.

.

+1

All Articles