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
This sketch demonstrates the usage of External Interrupts (on pins) to wakeup a chip in sleep mode.
5
+
Sleep modes allow a significant drop in the power usage of a board while it does nothing waiting for an event to happen. Battery powered application can take advantage of these modes to enhance battery life significantly.
6
+
7
+
In this sketch, shorting pin 8 to a GND will wake up the board.
8
+
Please note that, if the processor is sleeping, a new sketch can't be uploaded. To overcome this, manually reset the board (usually with a single or double tap to the RESET button)
9
+
10
+
This example code is in the public domain.
11
+
*/
12
+
13
+
#include"ArduinoLowPower.h"
14
+
15
+
// Blink sequence number
16
+
// Declare it volatile since it's incremented inside an interrupt
17
+
volatileint repetitions = 1;
18
+
19
+
// Pin used to trigger a wakeup
20
+
constint pin = 8;
21
+
22
+
voidsetup() {
23
+
pinMode(LED_BUILTIN, OUTPUT);
24
+
// Attach a wakeup interrupt on pin 8, calling repetitionsIncrease when the device is woken up
This sketch demonstrates the usage of Internal Interrupts to wakeup a chip in sleep mode.
5
+
Sleep modes allow a significant drop in the power usage of a board while it does nothing waiting for an event to happen. Battery powered application can take advantage of these modes to enhance battery life significantly.
6
+
7
+
In this sketch, the internal RTC will wake up the processor every 2 seconds.
8
+
Please note that, if the processor is sleeping, a new sketch can't be uploaded. To overcome this, manually reset the board (usually with a single or double tap to the RESET button)
9
+
10
+
This example code is in the public domain.
11
+
*/
12
+
13
+
#include"ArduinoLowPower.h"
14
+
15
+
voidsetup() {
16
+
pinMode(LED_BUILTIN, OUTPUT);
17
+
// Uncomment this function if you wish to attach function dummy when RTC wakes up the chip
0 commit comments