mirror of
https://github.com/Xinyuan-LilyGO/TTGO_TWatch_Library.git
synced 2026-03-05 07:44:11 +01:00
27 lines
574 B
C++
27 lines
574 B
C++
#include "config.h"
|
|
|
|
TTGOClass *ttgo;
|
|
|
|
#define uS_TO_S_FACTOR 1000000ULL /* Conversion factor for micro seconds to seconds */
|
|
#define TIME_TO_SLEEP 15 /* Time ESP32 will go to sleep (in seconds) */
|
|
|
|
void setup()
|
|
{
|
|
ttgo = TTGOClass::getWatch();
|
|
ttgo->begin();
|
|
ttgo->openBL();
|
|
ttgo->tft->fillScreen(rand() % 0xFFFF);
|
|
delay(3000);
|
|
ttgo->power->setPowerOutPut(0xFF, false);
|
|
ttgo->displaySleep();
|
|
esp_sleep_enable_timer_wakeup(uS_TO_S_FACTOR * TIME_TO_SLEEP);
|
|
esp_deep_sleep_start();
|
|
}
|
|
|
|
void loop()
|
|
{
|
|
}
|
|
|
|
|
|
|