I am implementing LCD and touch using tft_espi and xpt2046 on esp32-s3 custom board
But the touch function does not work properly
Even if I do not touch, the value always comes out as
X = -26, Y = -20 Pressure = 4095
And the touch does not work
Just in case, I disconnected the MISO of the LCD
I am using spi2 of esp32-s3
Is there a way to use spi2 on xpt2046?
Could the LCD be broken?
The source code is below
XPT2046_Touchscreen touchscreen(TOUCH_CS);
TFT_eSPI tft = TFT_eSPI();
void setup() {
Serial.begin(115200);
tft.init();
tft.fillScreen(TFT_WHITE);
tft.setTextColor(TFT_BLACK, TFT_WHITE);
touchscreen.begin();
}
void loop() {
if (touchscreen.touched()) {
TS_Point p = touchscreen.getPoint();
Serial.print("X = ");
Serial.print(p.x);
Serial.print(" | Y = ");
Serial.print(p.y);
Serial.print(" | Pressure = ");
Serial.print(p.z);
Serial.println();
delay(100);
}
}