From 5456a1f69885ed9a670c156ab6326b2f0965b76e Mon Sep 17 00:00:00 2001 From: Martino Facchin Date: Thu, 13 Jul 2017 16:56:25 +0200 Subject: [PATCH] [Examples] Avoid spurious wakeup --- examples/ExternalWakeup/ExternalWakeup.ino | 2 ++ 1 file changed, 2 insertions(+) diff --git a/examples/ExternalWakeup/ExternalWakeup.ino b/examples/ExternalWakeup/ExternalWakeup.ino index 09a7610..6151258 100644 --- a/examples/ExternalWakeup/ExternalWakeup.ino +++ b/examples/ExternalWakeup/ExternalWakeup.ino @@ -21,6 +21,8 @@ const int pin = 8; void setup() { pinMode(LED_BUILTIN, OUTPUT); + // Set pin 8 as INPUT_PULLUP to avoid spurious wakeup + pinMode(pin, INPUT_PULLUP); // Attach a wakeup interrupt on pin 8, calling repetitionsIncrease when the device is woken up LowPower.attachInterruptWakeup(pin, repetitionsIncrease, CHANGE); }