Hello everyone I cant get this touch to work on my esp32 and the 8 bit display touch 2.4.
this is my code
#include <SPI.h>
#include <TFT_eSPI.h> // Includes the settings from your edited User_Setup.h
TFT_eSPI tft = TFT_eSPI();
// Array to store the 5 calibration values (must be saved after calibration!)
uint16_t calibrationData[5] = { 0, 0, 0, 0, 0 };
void setup() {
Serial.begin(115200);
// 1. Initialize the Display
// This reads your new pin definitions from User_Setup.h
tft.init();
tft.setRotation(1); // Set to landscape mode
// 2. Clear screen and display title
tft.fillScreen(TFT_BLACK);
tft.setTextColor(TFT_YELLOW);
tft.setTextSize(2);
tft.setCursor(5, 5);
tft.println("ESP32 Parallel Shield");
tft.println("Touch Calibration...");
// 3. Run the touch calibration routine
// This will display target points for you to touch
tft.calibrateTouch(calibrationData, TFT_MAGENTA, TFT_BLACK, 15);
// 4. Print and display the results
Serial.println("\n--- Calibration Data ---");
Serial.print("Copy and Save this data: ");
tft.fillScreen(TFT_BLACK);
tft.setTextColor(TFT_GREEN, TFT_BLACK);
tft.setCursor(5, 5);
tft.println("CALIBRATION COMPLETE!");
tft.print("Save this 5-number array: ");
tft.setTextSize(1);
for (int i = 0; i < 5; i++) {
Serial.print(calibrationData[i]);
tft.print(calibrationData[i]);
if (i < 4) {
Serial.print(", ");
tft.print(", ");
}
}
Serial.println();
}
void loop() {
// Test loop: Draw circles where touched
uint16_t x, y;
#ifdef TOUCH_CS
// tft.getTouch reads the calibrated position
if (tft.getTouch(&x, &y)) {
// Draw a small point/circle at the touch location
tft.drawCircle(x, y, 5, TFT_RED);
Serial.printf("Touch at X: %d, Y: %d\n", x, y);
}
#else
// No touch functionality available
#endif
delay(100);
}
and I get this error
In file included from /run/arduino/sketches/new_sketch_1765651494804/new_sketch_1765651494804.ino:2:
/var/run/arduino/custom-libraries/TFT_eSPI/TFT_eSPI.h:875:8: error: #error >>>>------>> Touch functions not supported in 8/16 bit parallel mode or with RP2040 PIO.
#error >>>>------>> Touch functions not supported in 8/16 bit parallel mode or with RP2040 PIO.
^~~~~
I am alittle stuck here is the tft.eSPI user.setup.h
// ---------------------------------------------------------------------------------
// DRIVER AND INTERFACE CONFIGURATION
// ---------------------------------------------------------------------------------
#define ILI9341_DRIVER // Use the ILI9341 driver
#define ESP32_PARALLEL // Essential for ESP32 parallel timing
// CONTROL PINS (YOUR NEW ASSIGNMENTS)
#define TFT_CS 33
#define TFT_DC 15
#define TFT_RST 19
#define TFT_WR 32 // Shared with T_DO (X-)
#define TFT_RD 25 // Shared with T_DIN (Y+)
// DATA BUS PINS (UNCHANGED)
#define TFT_D0 12
#define TFT_D1 13
#define TFT_D2 26
#define TFT_D3 18
#define TFT_D4 17
#define TFT_D5 16
#define TFT_D6 27
#define TFT_D7 14
// ---------------------------------------------------------------------------------
// ANALOG RESISTIVE TOUCH CONFIGURATION
// ---------------------------------------------------------------------------------
#define RESISTIVE_TOUCH
// Touch Pin Mapping (Mapped to the shared pins above):
#define TOUCH_CLK 33 // X+ (Digital Drive) -> LCD_CS
#define TOUCH_CS 15 // Y- (Digital Drive) -> LCD_RS
#define TOUCH_DIN 25 // Y+ (ADC Read) -> LCD_RD
#define TOUCH_DO 32 // X- (ADC Read) -> LCD_WR
can anyone help me please