Skip to content

Commit 5456a1f

Browse files
committed
[Examples] Avoid spurious wakeup
1 parent 71ceedc commit 5456a1f

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

examples/ExternalWakeup/ExternalWakeup.ino

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ const int pin = 8;
2121

2222
void setup() {
2323
pinMode(LED_BUILTIN, OUTPUT);
24+
// Set pin 8 as INPUT_PULLUP to avoid spurious wakeup
25+
pinMode(pin, INPUT_PULLUP);
2426
// Attach a wakeup interrupt on pin 8, calling repetitionsIncrease when the device is woken up
2527
LowPower.attachInterruptWakeup(pin, repetitionsIncrease, CHANGE);
2628
}

0 commit comments

Comments
 (0)