Add ESP deep sleep test
This commit is contained in:
parent
2fbb235fbb
commit
a01a7607f8
1 changed files with 29 additions and 0 deletions
29
deepsleep/deepsleep.ino
Normal file
29
deepsleep/deepsleep.ino
Normal 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…
Reference in a new issue