RFModulator
Member
I am finishing up the development of a prototype using the Teensy 3.6. I have some pushbuttons and toggle switches that I debounce using the Bounce library. Occasionally, a button's action that is called by Bounce's risingEdge or falllingEdge is not triggered when the device comes out of hibernate. FWIW, I also use an AlarmTimer in my SnoozeBlock.
I saw this example code on Duff's Github page (Low_Power_Push_Button_Hold_SD_Logger.ino, lines 109-117) and I wonder if my problem might be because I don't perform the bolded operations:
Are these two statements true because of the details of this particular program, or are these things always true when using Bounce in conjunction with Snooze? If the latter is true, I'm curious as to why that is.
By the way - I am very happy with the Snooze library! Switching my prototype from an Arduino Mega + a bunch of shields over to a Teensy with all the built-in functionality, as well as all the other improvements, has been a great decision
Thanks!
I saw this example code on Duff's Github page (Low_Power_Push_Button_Hold_SD_Logger.ino, lines 109-117) and I wonder if my problem might be because I don't perform the bolded operations:
Code:
[b]// you need to update bounce before sleeping.[/b]
button.update();
// put Teensy into low power sleep mode
Snooze.hibernate( config );
digitalWriteFast(LED_BUILTIN, HIGH);
// debounce timer
elapsedMillis timeout = 0;
[b]// after waking must update Bounce for longer than debounce time[/b]
while (timeout < 6) button.update();
Are these two statements true because of the details of this particular program, or are these things always true when using Bounce in conjunction with Snooze? If the latter is true, I'm curious as to why that is.
By the way - I am very happy with the Snooze library! Switching my prototype from an Arduino Mega + a bunch of shields over to a Teensy with all the built-in functionality, as well as all the other improvements, has been a great decision
Thanks!