1
0
mirror of https://github.com/arduino-libraries/ArduinoLowPower.git synced 2025-04-19 11:42:14 +03:00

[Examples] Avoid spurious wakeup

This commit is contained in:
Martino Facchin 2017-07-13 16:56:25 +02:00
parent 71ceedc1d7
commit 5456a1f698

View File

@ -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);
}