Add ESP deep sleep test

This commit is contained in:
Starbeamrainbowlabs 2018-04-20 22:40:43 +01:00
parent 2fbb235fbb
commit a01a7607f8
Signed by: sbrl
GPG key ID: 1BE5172E637709C2

29
deepsleep/deepsleep.ino Normal file
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() {
}