Getting TFT_eSPI examples to work on the Lilygo T-Embed-S3
Getting TFT_eSPI examples to work on the Lilygo T-Embed-S3
The problem
I have a Lilygo T-Embed-S3 module. This refused to display anything whenever I built the examples from the TFT_eSPI examples directory. Other examples supplied by Lilygo that do not use this library did work. I found some example code written by a YouTuber called Volos that displays refined gauges here. I admire the mathematical sophistication of his code - he creates the graphics from first principles. Clearly the TFT_eSPI library works as does my display. Hoever, whenever I build the examples from the TFT_eSPI folder I get a blank display.
The solution
My Lilygo T-Embed-S3 remained blank until I added the lines in bold to the TFT_eSPI examples. I build and load these files using the platformio plug-in with VSCode running on Debian.
#define PIN_POWER_ON 46
void setup(void) {
pinMode(PIN_POWER_ON, OUTPUT);
digitalWrite(PIN_POWER_ON, HIGH);
tft.init();
Simple fix. The display is not being turned on in the examples. I can understand this on the TFT_eSPI GitHub repository as this cannot be expected to cater for all the hardware variations it will run on. However, I feel this should be fixed in the repository supplied by Lilygo for the T-Embed-S3 board.
The TFT_eWidget examples also display with this fix. Please admire the AnalogueMeters example below. I don’t spell analog like that either. The needles are waggling up and down. I need to rotate and scale the image but at least I can see something!
The module is a great bit of kit. There are expansion headers in the module which allow a little daughter board to be fit inside. Along with a battery management IC and connector, rotary dial and button, this makes for a useful bit of kit that is supplied with an attractive case. I can modify this for assistive technology and give it out, rather than the home made kludges I have produced up to now.