Browse Source

Add ESP deep sleep test

master
Starbeamrainbowlabs 2 years ago
parent
commit
a01a7607f8
Signed by: sbrl GPG Key ID: 1BE5172E637709C2
1 changed files with 29 additions and 0 deletions
  1. +29
    -0
      deepsleep/deepsleep.ino

+ 29
- 0
deepsleep/deepsleep.ino View File

@ -0,0 +1,29 @@
void setup() {
Serial.begin(9600);
Serial.print("Initialising - ");
pinMode(D0, WAKEUP_PULLUP);
pinMode(LED_BUILTIN, OUTPUT);
Serial.println("done");
Serial.println("Waiting: ");
digitalWrite(LED_BUILTIN, HIGH);
for(int i = 0; i < 5; i++) {
delay(1000);
Serial.print(".");
}
digitalWrite(LED_BUILTIN, LOW);
Serial.println();
Serial.println("Entering deep sleep.");
ESP.deepSleep(5 * 1000000);
Serial.begin(9600);
Serial.println("Sleep complete");
}
void loop() {
}

Loading…
Cancel
Save