arduino/deepsleep/deepsleep.ino

29 lines
497 B
C++

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() {
}