Go Down

Topic: Time Library added to Playground (Read 39 times) previous topic - next topic

Glasshopper

Quote

? timerRepeat is only in seconds and not formatted like alarmRepeat ?
You should be able to set timers just like alarms, did you try something like :  Alarm.timerRepeat( 1,30,0, TimerTask);   // set timer to repeat every 1 hour and 30 minutes


I see..
 Alarm.timerRepeat(1, 0, Repeats);
does not work
but
 Alarm.timerRepeat( 0, 1, 0, Repeats);
does.

thank you :D

mem

I could add the overloaded versions if that functionality is what most people expect:

timerRepeat(Period, TimerFunction); // Period in seconds
timerRepeat(Minutes, Seconds, TimerFunction); // Period in Minutes & seconds
timerRepeat(Hours, Minutes, Seconds, TimerFunction); // Period in Hours, Minutes & seconds

then  Alarm.timerRepeat(1, 0, Repeats)  would do the same thing as Alarm.timerRepeat(0, 1, 0, Repeats);

Peeter123

#32
Jan 21, 2010, 03:35 pm Last Edit: Jan 21, 2010, 03:39 pm by Peeter123 Reason: 1
I think you should make overloaded functions in the library. It's more logical.

For example when I say I'm gonna do something in 5 minutes, I don't say I'm gonna do something in 0 hours and 5 minutes ;)

Btw I have uploaded the sourcecode of the timesync application:

http://www.megaupload.com/?d=YIEMNV9W

adambrum

I have being having a play with the 1307rtc and alarm code and it works great apart from one thing.

When i have used other 1307 codes the rtc keeps the time when the power is off ( i have a sparkfun rtc with battery ) with the new code it resets the time and i cant find a way to set the rtc time so when i disconect the power the rtc stores the time.

Any ideas around this because apart from that the codes great and a lot less fuss thatn other codes.

Thanks Adam

mem

#34
Jan 30, 2010, 02:01 pm Last Edit: Jan 30, 2010, 02:02 pm by mem Reason: 1
Quote
..with the new code it resets the time and i cant find a way to set the rtc time so when i disconect the power the rtc stores the time.

Adam, can you clarify the problem you are having.

Is it that you can't set the time on the rtc (using the TimeRTCSet.pde sketch in the download)?

Or that once the time is set it does not display correctly when you disconnect and reconnect power with the RTC board connected to the Arduino board?  If the latter, check that the battery in the RTC board is ok.

Go Up