is there anyway to clear the previous alarms that was already set?
max alarms i can input is 6 without changing the " #define dtNBR_ALARMS 6 " in TimeAlarms.h.
the code shows that in the afterNoonAlarm2(), the time is being reset to the initial time i set during setup.
after repeating the alarms, some of them won't work anymore. is there a way to clear the alarms?
#include <TimeAlarms.h>
#include <Time.h>
void setup()
{
Serial.begin(9600);
setTime(17,30,31,1,1,11);
pinMode(13, OUTPUT);
Alarm.alarmRepeat(17,30,33, afterNoonAlarm);
Alarm.alarmRepeat(17,30,36, afterNoonAlarm);
Alarm.alarmRepeat(17,30,39, afterNoonAlarm2);
}
void loop(){
digitalClockDisplay();
Alarm.delay(1000); // wait one second between clock display
}
// functions to be called when an alarm triggers:
void afterNoonAlarm(){
Serial.println("Alarm: - turn lights on");
digitalWrite(13, HIGH);
Alarm.timerOnce(2, offIt);
}
// functions to be called when an alarm triggers:
void afterNoonAlarm2(){
setTime(17,30,31,1,1,11);
Alarm.alarmRepeat(17,30,33, afterNoonAlarm);
Alarm.alarmRepeat(17,30,36, afterNoonAlarm);
Alarm.alarmRepeat(17,30,39, afterNoonAlarm2);
}
void offIt(){
Serial.println("Alarm: - turn lights off");
digitalWrite(13, LOW);
}
void digitalClockDisplay()
{
// digital clock display of the time
Serial.print(hour());
printDigits(minute());
printDigits(second());
Serial.println();
}
void printDigits(int digits)
{
Serial.print(":");
if(digits < 10)
Serial.print('0');
Serial.print(digits);
}
the log shows that after repeating the time and resetting the alarm, one of the function wasn't called.(attached picture)
help please. Thank You so much
