Go Down

Topic: Meddling with the runtime clock (Read 442 times) previous topic - next topic

urthlight

Is there some way to set the run-time clock other than waiting 49 days for the clock to turn over. I need to certify that the rollover will be uneventful.

PaulS

Quote
I need to certify that the rollover will be uneventful.

Use micros(), instead. Works the same way, but a much shorter fuse.

billroy

I use code like this in the Bitlash rollover example (https://github.com/billroy/bitlash/blob/master/examples/rollover/rollover.ino):

Code: [Select]

extern volatile unsigned long timer0_millis;

void setMillis(unsigned long newtime) {
uint8_t oldSREG = SREG;
cli();
timer0_millis = newtime;
SREG = oldSREG;
})


-br

Nick Gammon


Is there some way to set the run-time clock other than waiting 49 days for the clock to turn over. I need to certify that the rollover will be uneventful.



Just build your own time machine:

http://science.discovery.com/games-and-interactives/build-your-own-time-machine.htm

urthlight

Quote
Just build your own time machine:

This might take longer than 49 days.

Go Up