Skip to content

Commit

Permalink
Rework low power example
Browse files Browse the repository at this point in the history
  • Loading branch information
sebromero committed May 7, 2024
1 parent b59b709 commit 8166a9a
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions examples/DeepSleep_WakeFromRTC_C33/DeepSleep_WakeFromRTC_C33.ino
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@ Board board;
Charger charger;

void setup() {
pinMode(LED_BUILTIN, OUTPUT);
digitalWrite(LED_BUILTIN, LOW);

RTC.begin();

digitalWrite(LED_BUILTIN, digitalRead(LED_BUILTIN));

manager = PowerManagement();
manager.begin();
Expand All @@ -25,10 +26,12 @@ void setup() {

if (!RTC.isRunning()) {
RTC.setTime(initial_time);
board.sleepFor(0, 0, 1);
}

pinMode(LED_BUILTIN, OUTPUT);
digitalWrite(LED_BUILTIN, HIGH);
board.sleepFor(0, 0, 10);

// Turn LED on to indicate the board is awake
digitalWrite(LED_BUILTIN, LOW);
}

Expand Down

0 comments on commit 8166a9a

Please sign in to comment.