arduino/deepsleep/deepsleep.ino

30 lines
497 B
Arduino
Raw Normal View History

2018-04-20 21:40:43 +00:00
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() {
}