Xinyuan-LilyGO / T-QT

MIT License
94 stars 31 forks source link

display backlight doesent remain OFF when deepSleep #13

Closed Gargantuanman closed 1 year ago

Gargantuanman commented 1 year ago

Currently Im executing this piece of code:

if (goToSleep) { //Serial.println("I need to Sleep"); gfx->displayOff(); digitalWrite(TFT_BL, HIGH); // turn OFF ledcWrite(pwmLedChannelTFT, 255); // brightness 0 - 255 esp_deep_sleep_start(); }

I noticed that the screen backlight turns off brieftly but when the micro sleeps it turn on again (only Back light) i believe is because of the default state of the pin is LOW, is therea a workaround this issue?

The battery will dryout quickly if the BL cannot turn off.

Gargantuanman commented 1 year ago

SOLVED just included this library and used those two commands.

include "esp_sleep.h"

if (goToSleep) { //Serial.println("I need to Sleep"); gfx->displayOff(); digitalWrite(TFT_BL, HIGH); // turn OFF gpio_hold_en(GPIO_NUM_10); gpio_deep_sleep_hold_en(); esp_deep_sleep_start(); }