RTC Emulator ?
adri
Posts: 34
Hi,
Anyone got any samples of doing date maths with this object?
eg. Say I want the same thing to happen every day at a certain time. Would I have to start parsing the strings?
If one wasn't using the RTC object would it be possible to do a waitcnt(6912000000000 + cnt) as representing a 24 hour wait...seems a bit odd.
Many thanks
Adri
Anyone got any samples of doing date maths with this object?
eg. Say I want the same thing to happen every day at a certain time. Would I have to start parsing the strings?
If one wasn't using the RTC object would it be possible to do a waitcnt(6912000000000 + cnt) as representing a 24 hour wait...seems a bit odd.
Many thanks
Adri
Comments
Just do a string-compare with a time string you set in your program in format hh[noparse]:mm:[/noparse]ss like "12:30:25".
You can't do a waitcnt( a_vew_hours_later ;o) ... The internal counter is 32 bits, which gives you a max. waittime of ~50sec at 80MHz.