Originally Posted by Caver
Just a quick report before bed...
Compiled & loaded v3 earlier this evening with my alarm schedule loaded.
It looks like the RTC isn't running correctly. The time never displays in the serial monitor window and the controller never switched modes per the alarms set.
The manual control via the serial monitor works great, so the LED is working.
Unfortunately...being a work night, I can't stay up to play with it, so I'll dig into it after work tomorrow and keep watch here.
Ok, thanks. I see what's happening. If you have DEBUG_IR defined (and you do since you can send in tests), then it just sits and waits on you to send it something. The Alarms don't happen because Alarm.delay(which is required to make them work) isn't being called while it just sits in loop() waiting for a command. Once you send in a command, then Alarm.delay gets called and all of your alarms you had set that have backed up should fire all at once. Not good.
The reason the time isn't displayed is because I omitted it when in debug mode. The reason I omitted it and the Alarm.delay call is because otherwise it would sit in the delay for 15 minutes before checking to see if you sent in a command. Also not good.
I should have done a better job of implementing the serial command feature. But I viewed it more as a test feature that you’d use to verify you could control the light and then you’d disable it. But I guess it is a nice a feature to have that opens up all sorts of opportunities, like enabling/disabling storm modes on the fly, changing the alarm times on the fly and so on.
So with that in mind, I’ve modified the code so that you can leave DEBUG_IR defined and still have everything else work like it’s supposed to. It should work now….maybe..
I'll update it above, instead of re-posting it. Here is a link: