Skip to content

Commit 8166a9a

Browse files
committed
Rework low power example
1 parent b59b709 commit 8166a9a

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

Diff for: examples/DeepSleep_WakeFromRTC_C33/DeepSleep_WakeFromRTC_C33.ino

+7-4
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,10 @@ Board board;
1111
Charger charger;
1212

1313
void setup() {
14+
pinMode(LED_BUILTIN, OUTPUT);
15+
digitalWrite(LED_BUILTIN, LOW);
16+
1417
RTC.begin();
15-
16-
digitalWrite(LED_BUILTIN, digitalRead(LED_BUILTIN));
1718

1819
manager = PowerManagement();
1920
manager.begin();
@@ -25,10 +26,12 @@ void setup() {
2526

2627
if (!RTC.isRunning()) {
2728
RTC.setTime(initial_time);
28-
board.sleepFor(0, 0, 1);
2929
}
3030

31-
pinMode(LED_BUILTIN, OUTPUT);
31+
digitalWrite(LED_BUILTIN, HIGH);
32+
board.sleepFor(0, 0, 10);
33+
34+
// Turn LED on to indicate the board is awake
3235
digitalWrite(LED_BUILTIN, LOW);
3336
}
3437

0 commit comments

Comments
 (0)