Been searching around to find out what exactly happens to the millis() output after rollover, but I'm not finding anything.
This is the active part of my code, using the DS1307 library to talk to a RTC which currently it's data requested once a second, but since I will be doing more with the program I can't really use a delay, that and I don't like to use delays if at all possible.
The easiest way I can see is to detect the 50 day millis() rollover, but not knowing what happens to the stored number makes that difficult :
void doClock(){ // Currently the only thing called from loop()
if (millis() - checkRTCmillis > 1000) {
checkRTCmillis = millis();
RTC.get(rtc,true);
if(rtc[2] < 10){LED.print("0");}
LED.print(rtc[2]); // LED.print uses newsoftserial to talk to a serial LED display
if(rtc[1] < 10){LED.print("0");}
LED.print(rtc[1]);
}
}
Also, since I have a RTC it would be very easy to wait for a bit less than the millis() rollover, then trigger a function to detect when it actually happens, not sure if that would be necessary though.