Hello
I am trying to get response from a touch on the screen of the ILI9488. I have read many post and the answer given did not resolve my problem.
First I check the the ILI screen I bought have a XPT2036 chip.
I check also the wiring and the confihuration of the User_setup. h for the TFT_eSPI library and I can write text on the screen.
Here is the short code I use to test my ILI9488 touchscreen.
// Testing ILI9488 TouchScreen with ESP32 WROOM
/*****************
Pin Definition:
#define TFT_MISO 19
#define TFT_MOSI 23
#define TFT_SCLK 18
#define TFT_CS 15 // Chip select control pin
#define TFT_DC 4 // Data Command control pin
#define TFT_RST -1 // Set TFT_RST to -1 if display RESET is connected to ESP32 board RST
//#define TOUCH_CS 2 // Chip select pin (T_CS) of touch screen
***************/
/**************
Frequencies
#define SPI_FREQUENCY 40000000
// Optional reduced SPI frequency for reading TFT
#define SPI_READ_FREQUENCY 20000000
// The XPT2046 requires a lower SPI clock rate of 2.5MHz so we define that here:
#define SPI_TOUCH_FREQUENCY 2500000
***********************/
#include <TFT_eSPI.h>
#include <XPT2046_Touchscreen.h>
#define CS_PIN 2
XPT2046_Touchscreen ts(CS_PIN);
void setup() {
Serial.begin(115200);
ts.begin();
ts.setRotation(1);
}
void loop() {
if (ts.touched()) {
TS_Point p = ts.getPoint();
Serial.print("Pressure = ");
Serial.print(p.z);
Serial.print(", x = ");
Serial.print(p.x);
Serial.print(", y = ");
Serial.print(p.y);
delay(600);
Serial.println();
}
}
With this code I get a constant "Pressure = 4095, x=0, y=0" response whatever I touch the screen or not.
I have tried other code without any success!
So I need your help
Claude
