I’m testing a new Lilygo T-Display S3 Touch. Unfortunately, the library does not load properly.
Can anyone help me?
Processing lilygo-t-display-s3 (platform: espressif32; board: lilygo-t-display-s3; framework: arduino)
----------------------------------------------------------------------------------------------------------------------------------------------------Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/espressif32/lilygo-t-display-s3.html
PLATFORM: Espressif 32 (6.5.0) > LilyGo T-Display-S3
HARDWARE: ESP32S3 240MHz, 320KB RAM, 16MB Flash
DEBUG: Current (cmsis-dap) External (cmsis-dap, esp-bridge, esp-builtin, esp-prog, iot-bus-jtag, jlink, minimodule, olimex-arm-usb-ocd, olimex-arm-usb-ocd-h, olimex-arm-usb-tiny-h, olimex-jtag-tiny, tumpa)
PACKAGES:
- framework-arduinoespressif32 @ 3.20014.231204 (2.0.14)
- tool-esptoolpy @ 1.40501.0 (4.5.1)
- toolchain-riscv32-esp @ 8.4.0+2021r2-patch5
- toolchain-xtensa-esp32s3 @ 8.4.0+2021r2-patch5
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 34 compatible libraries
Scanning dependencies...
Dependency Graph
|-- Adafruit MPR121 @ 1.0.2+sha.f05257c
|-- Wire @ 2.0.0
Building in release mode
Compiling .pio\build\lilygo-t-display-s3\src\main.cpp.o
Building .pio\build\lilygo-t-display-s3\bootloader.bin
Generating partitions .pio\build\lilygo-t-display-s3\partitions.bin
Compiling .pio\build\lilygo-t-display-s3\lib131\Wire\Wire.cpp.o
esptool.py v4.5.1
Creating esp32s3 image...
Merged 1 ELF section
Successfully created esp32s3 image.
Compiling .pio\build\lilygo-t-display-s3\lib62f\Adafruit MPR121\Adafruit_MPR121.cpp.o
Compiling .pio\build\lilygo-t-display-s3\FrameworkArduino\Esp.cpp.o
src/main.cpp:27:10: fatal error: TFT_eSPI.h: No such file or directory
******************************************************************
* Looking for TFT_eSPI.h dependency? Check our library registry!
*
* CLI > platformio lib search "header:TFT_eSPI.h"
* Web > https://registry.platformio.org/search?q=header:TFT_eSPI.h
*
******************************************************************
#include "TFT_eSPI.h" /* Please use the TFT library provided in the library. */
^~~~~~~~~~~~
compilation terminated.
*** [.pio\build\lilygo-t-display-s3\src\main.cpp.o] Error 1
.pio/libdeps/lilygo-t-display-s3/Adafruit MPR121/Adafruit_MPR121.cpp: In member function 'boolean Adafruit_MPR121::begin(uint8_t, TwoWire*)':
.pio/libdeps/lilygo-t-display-s3/Adafruit MPR121/Adafruit_MPR121.cpp:69:25: warning: 'void Adafruit_MPR121::setThreshholds(uint8_t, uint8_t)' is deprecated [-Wdeprecated-declarations]
setThreshholds(12, 6);
^
In file included from .pio/libdeps/lilygo-t-display-s3/Adafruit MPR121/Adafruit_MPR121.cpp:29:
.pio/libdeps/lilygo-t-display-s3/Adafruit MPR121/Adafruit_MPR121.h:96:8: note: declared here
void setThreshholds(uint8_t touch, uint8_t release)
^~~~~~~~~~~~~~
=========================================================== [FAILED] Took 15.08 seconds ===========================================================
platform.ini
[env:lilygo-t-display-s3]
platform = espressif32
board = lilygo-t-display-s3
framework = arduino
; change microcontroller
board_build.mcu = esp32s3
; change MCU frequency
board_build.f_cpu = 240000000L
lib_deps =
https://github.com/Xinyuan-LilyGO/T-Display-S3.git
Test-Code:
#include "Arduino.h"
// 170 x 320
#define TOUCH_MODULES_CST_SELF
#include "Arduino.h"
#include "TFT_eSPI.h" /* Please use the TFT library provided in the library. */
#include "TouchLib.h"
#include "Wire.h"
#include "pin_config.h"
TouchLib touch(Wire, PIN_IIC_SDA, PIN_IIC_SCL, CTS820_SLAVE_ADDRESS, PIN_TOUCH_RES);
TFT_eSPI tft = TFT_eSPI();
TFT_eSprite sprite = TFT_eSprite(&tft);
int deb=0;
bool switch1=true;
bool switch2=false;
void setup() {
pinMode(PIN_POWER_ON, OUTPUT);
digitalWrite(PIN_POWER_ON, HIGH);
pinMode(PIN_TOUCH_RES, OUTPUT);
digitalWrite(PIN_TOUCH_RES, LOW);
delay(500);
digitalWrite(PIN_TOUCH_RES, HIGH);
tft.begin();
sprite.createSprite(170,320);
sprite.setTextColor(TFT_WHITE,TFT_BLACK);
Wire.begin(PIN_IIC_SDA, PIN_IIC_SCL);
draw(-1,-1);
}
void draw(int x, int y)
{
sprite.fillSprite(TFT_BLACK);
if(y<160)
switch1=!switch1;
else
switch2=!switch2;
sprite.drawString("SWITCH1= "+String(switch1),20,30,4);
sprite.drawRect(18,58,134,54,TFT_GREEN);
sprite.fillRect(20+(switch1*80),60,50,50,TFT_GREEN);
sprite.drawString("SWITCH2= "+String(switch2),20,190,4);
sprite.drawRect(18,218,134,54,TFT_YELLOW);
sprite.fillRect(20+(switch2*80),220,50,50,TFT_YELLOW);
sprite.pushSprite(0,0);
}
void loop() {
if (touch.read()) {
if(deb==0){
deb=1;
TP_Point t = touch.getPoint(0);
if(t.x<170)
draw(t.x,t.y);
} }else {
deb=0;}
}