Hi,
I am looking to use the DS3231 I2C RTC for a data logging project and I have been trying and failing to find a nice way to find out when the next nice round 5 Minute time value is reached....
The RTC can give total seconds since the begining of time itself (ie year 2000) with
now.get()2012/12/6 18:26:11 Fri
Seconds since 1/1/2000: 408133571
I am hoping to find the next round 5 minute time value and start logging from then:
So the time I am interested in, relative to the time above, would be 18:30:00.
Any idea how I would calculate a new 'rounded seconds count value' (ie the 408133571 number) so that I can evaluate it against the current time and then proceed when one equals the other?
long now = 408133571
long rounded = 40813xxxx ?
If now = rounded then..... do something.
Thanks for any help.