Arduino
Материал из lulzette's wiki
arduino/esp
reset
ESP.restart()
Reason:
boot 0x13, SPI_FAST_FLASH_BOOT
sleeps
- modem sleep - 15 mA, WiFi - off, System clock, RTC, CPU - on
- light sleep - 0.4 mA, Wifi, System clock - off, RTC - on, CPU - pending
- deep sleep - 20 uA, WiFi, System clock, CPU - off, RTC - on
modem sleep
by default
WiFi.forceSleepBegin();
WiFi.forceSleepWake();
light sleep
add this at the top
extern "C" {
#include "user_interface.h"
}
and
WiFi.mode(WIFI_STA);
wifi_set_sleep_type(LIGHT_SLEEP_T);
delay(1000);
- esp8266 is sleeping
deep sleep
connect D0 to RST
add
ESP.deepSleep(36e7);
when you want to sleep
esp will reset after 36e7 uSeconds (36*10^7 seconds)
restart
ESP.restart()
boot 0x13, SPI_FAST_FLASH_BOOT