Loading...
Pages: [1]   Go Down
Author Topic: Reconfigyring the Alarm (TimeAlarms library)  (Read 29 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 4
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi.

I'm using alarms from TimeAlarms library. It's working just fine. I can configure a alarmRepeat to turn on a relay at the given time.
The problem is, when I try to modify this alarm, it won't set turn the relay on again.
For example, the alarm was set to 19:20:00. It turned the relay on and, a minute later, off. So now I want it to do it again 19:30. I reconfigure the alarm, but nothing happens.
For instance, I save the alarm info in the EEPROM, and when I start the arduino I read it and configure the alarm. If I reset the arduino, 19:30 alarm will work. But just this once.

Here is how I'm configuring the alarm:
Code:
AlarmId alarme; //Alarme

//... some code
void setup(){
  //some more code

  // alarme -> the alarm ID
   alarme = Alarm.alarmRepeat(alarmTime[0],alarmTime[1],alarmTime[2], turnReleOn); //0 - hour, 1 - minute, 2 - second
}

// ... some code

And here is how I update my alarm time:
Code:
void updateAlarm(){
  time_t newTime =  AlarmHMS(alarmTime[0],alarmTime[1],alarmTime[2]);
  Alarm.write(alarme,newTime);
}

I can't see where I'm messing up.
I also tried to enable the alarm (even though the readme.txt says the write function is suposed to do that).
Logged

Seattle, WA USA
Online Online
Brattain Member
*****
Karma: 334
Posts: 36443
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
I can't see where I'm messing up.
Nor I. Maybe they can over at http://snippets-r-us.com.

Here, we expect to see ALL of your code.
Logged

Pages: [1]   Go Up
Print
 
Jump to: