I've been trying to change the time of a repeating alarm using the TimeAlarms library with no success. I want to be able to do this without changing and restarting the program. I'm making a timer and control system for a pool and will eventually want to change the time of the alarms by using up/down/enter buttons via a menu. My code is below. The commented lines are ones that didn't work. Actually, none of this has worked.
Below is the serial readout from the loop section leading up to triggering the code below. It can be seen from the readout that the time does change, but not the time I would like it to. For testing, I have the alarm triggering a second time 4 seconds after the alarm that shuts it off.
11:29:59
Filter 1 On ID = 3
Filter1 On time = 41398
Filter 1 Off ID = 3
Filter1 Off time = 41401
11:30:00
Filter 1 On ID = 3
Filter1 On time = 41398
Filter 1 Off ID = 3
Filter1 Off time = 41401
setNewAlarmTime() **************************************************** triggered
Newstart alarm value = 8
11:30:01
Filter 1 On ID = 3
Filter1 On time = 8
Filter 1 Off ID = 3
Filter1 Off time = 41401
11:30:02
Filter 1 On ID = 3
Filter1 On time = 8
Filter 1 Off ID = 3
Filter1 Off time = 41401
Gee thanks for the positive comments Paul. So glad I asked for help here on the forum. Clearly if I was a wizard at this, I wouldn't be asking questions. I thought the forum was a place us inexperienced could resolve problems with our programming. I wasn't finding any answers after 2 hours of searching, so I created the post. Do you always denigrate newbies in your comments? If you think I'm that stupid, you don't have to respond to morons like me.
Filt1On was declared in setup as demonstrated in the example sketch that comes with the alarms library. I didn't want to put every line of code in the post to keep it simple. I thought that if I've already declared it, it doesn't need saving.
As I said, the commented lines were ones which do not work, and free was one of them. It was just something I tried because nothing else was working.
In the Time library, time_t is declared as an integer, that is why I used it to declare newStart1.
So, I'm now no further educated than before I asked the question. Some code to resolve the issue would have been beneficial. I may not know what I'm doing at the moment, but I do know how to treat people with respect.
So, I'm now no further educated than before I asked the question.
Well, that's too bad. I told you that you need to keep track of the Alarm IDs. I can't see that you do that, because you decided that we didn't need to see all of your code.
You have far too much code for someone who can't even reset an alarm.