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:
parent
71ceedc1d7
commit
5456a1f698
@ -21,6 +21,8 @@ const int pin = 8;
|
|||||||
|
|
||||||
void setup() {
|
void setup() {
|
||||||
pinMode(LED_BUILTIN, OUTPUT);
|
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
|
// Attach a wakeup interrupt on pin 8, calling repetitionsIncrease when the device is woken up
|
||||||
LowPower.attachInterruptWakeup(pin, repetitionsIncrease, CHANGE);
|
LowPower.attachInterruptWakeup(pin, repetitionsIncrease, CHANGE);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user