lilygo-tdisplays3-esphome icon indicating copy to clipboard operation
lilygo-tdisplays3-esphome copied to clipboard

Latest TFT_eSPI library and dimmable backlight

Open bradmck opened this issue 1 year ago • 61 comments

This isn't a bug, I just wanted to share some info. I was able to get this working using the latest TFT_eSPI library - using the older custom_component method vs. the newer external_components method for now. I was also able to setup the backlight pin with ledc so it's dimmable. These were very simple changes to just a couple of header files in the TFT_eSPI library:

In User_Setup_Select.h comment out this line:

#include <User_Setup.h>

And uncomment this line:

//#include <User_Setups/Setup206_LilyGo_T_Display_S3.h>

In User_Setups/Setup206_LilyGo_T_Display_S3.h comment out these two lines:

#define TFT_BL 38  
#define TFT_BACKLIGHT_ON HIGH

Then in your ESPHome yaml file use this for the light - get rid of the GPIO switch and replace with this:

output:
  - platform: ledc
    pin: GPIO38
    id: gpio38
    frequency: 10000

light:
  - platform: monochromatic
    output: gpio38
    name: "Backlight"

bradmck avatar Mar 11 '23 21:03 bradmck