You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to be able to wake up the MKR1000 from an external interrupt. So far I've been trying different configurations and the only interrupt types that work are HIGH and LOW.
So CHANGE, RISING and FALLING are not triggering the external interruption while the board is in sleep mode. Here is my code:
#include<RTCZero.h>const byte button = 5;
bool ledIsOn = false;
volatilebool shouldBeSleeping = false;
RTCZero rtc;
voidsetup() {
rtc.begin();
pinMode(button, INPUT);
Serial.begin(115200);
attachInterrupt(button, interr, RISING);
Serial.println("== Interrupt test ==");
}
voidloop() {
if (shouldBeSleeping) {
Serial.println("Now going to sleep");
rtc.standbyMode();
}
digitalWrite(LED_BUILTIN, ledIsOn = !ledIsOn);
delay(1000);
}
voidinterr() {
Serial.println("Interruption triggered");
if (shouldBeSleeping) {
Serial.println("This line is never executed");
}
shouldBeSleeping = !shouldBeSleeping;
}