Compilation error TFT_eSPI (Round display Xiao ESP32S3)

Does anyone know how to resolve this error?

r: ‘class TFT_eSPI’ has no member named ‘getTouchRawZ’
Serial.printf(“z: %i \n”, tft.getTouchRawZ());

exit status 1

Compilation error: ‘class TFT_eSPI’ has no member named ‘getTouchRaw’

Hit There,
any chance you have the older or newer lib or can you comment the print out?
Any code also would help see what’s up. I played with the Round display with both libs so,
check out “round Display”
GL :slight_smile: PJ

Hi JP!
I have the new lib. I have done the Test_Touch_Controller example from the TFT_eSpi lib (2.5.23).
And the result is:
Compilation error: ‘class TFT_eSPI’ has no member named ‘getTouchRaw’.
Which part should I change in User_Setup.h of TFT_eSPI?
Thank you very much.

Hi there,
I think the LIB is the issue, “TFT_eSpi lib (2.5.23).”
get the ZIP and Add it to the IDE, remove any others you have.
Is the one I would use , it contains a keyword “getTouchRaw”
GL :slight_smile: PJ

so I tried it with my ESP32C2 and round display.
It compiled and runs on my unit. Be sure to read the Header about CS pins etc. for your hardware.

// This sketch is to test the touch controller, nothing is displayed
// on the TFT.  The TFT_eSPI library must be configured to suit your
// pins used. Make sure both the touch chip select and the TFT chip
// select are correctly defined to avoid SPI bus contention.

// Make sure you have defined a pin for the touch controller chip
// select line in the user setup file or you will see "no member"
// compile errors for the touch functions!

// It is a support and diagnostic sketch for the TFT_eSPI library:

// The "raw" (unprocessed) touch sensor outputs are sent to the
// serial port. Touching the screen should show changes to the x, y
// and z values. x and y are raw ADC readings, not pixel coordinates.

#include <SPI.h>
#include <TFT_eSPI.h>
TFT_eSPI tft = TFT_eSPI();


void setup(void) {
  delay(2500);  //relax...Get Ready for serial port
  Serial.println("Power ON ");  // Let's BEGIN!!
  Serial.println(" Program " __FILE__ " compiled on " __DATE__ " at " __TIME__ );



void loop() {

  uint16_t x, y;

  tft.getTouchRaw(&x, &y);
  Serial.printf("x: %i     ", x);

  Serial.printf("y: %i     ", y);

  Serial.printf("z: %i \n", tft.getTouchRawZ());





Using library SPI at version 2.0.0 in folder: C:\Users\Dude\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.11\libraries\SPI 
Using library TFT_eSPI at version 2.5.22 in folder: D:\Arduino_projects\libraries\TFT_eSPI 
Using library Wire at version 2.0.0 in folder: C:\Users\Dude\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.11\libraries\Wire 
Using library FS at version 2.0.0 in folder: C:\Users\Dude\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.11\libraries\FS 
Using library SPIFFS at version 2.0.0 in folder: C:\Users\Dude\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.11\libraries\SPIFFS 
"C:\\Users\\Dude\\AppData\\Local\\Arduino15\\packages\\esp32\\tools\\riscv32-esp-elf-gcc\\esp-2021r2-patch5-8.4.0/bin/riscv32-esp-elf-size" -A "C:\\Users\\Dude\\AppData\\Local\\Temp\\arduino\\sketches\\F500E0EDC3E34B1CFC3D4E62E2E2E44C/sketch_sep27a.ino.elf"
Sketch uses 278634 bytes (21%) of program storage space. Maximum is 1310720 bytes.
Global variables use 14172 bytes (4%) of dynamic memory, leaving 313508 bytes for local variables. Maximum is 327680 bytes.
"C:\Users\Dude\AppData\Local\Arduino15\packages\esp32\tools\esptool_py\4.5.1/esptool.exe" --chip esp32c3 --port "COM3" --baud 921600  --before default_reset --after hard_reset write_flash  -z --flash_mode dio --flash_freq 80m --flash_size 4MB 0x0 "C:\Users\Dude\AppData\Local\Temp\arduino\sketches\F500E0EDC3E34B1CFC3D4E62E2E2E44C/sketch_sep27a.ino.bootloader.bin" 0x8000 "C:\Users\Dude\AppData\Local\Temp\arduino\sketches\F500E0EDC3E34B1CFC3D4E62E2E2E44C/sketch_sep27a.ino.partitions.bin" 0xe000 "C:\Users\Dude\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.11/tools/partitions/boot_app0.bin" 0x10000 "C:\Users\Dude\AppData\Local\Temp\arduino\sketches\F500E0EDC3E34B1CFC3D4E62E2E2E44C/sketch_sep27a.ino.bin" v4.5.1
Serial port COM3
Chip is ESP32-C3 (revision v0.3)
Features: WiFi, BLE
Crystal is 40MHz
MAC: a0:76:4e:3f:a3:88
Uploading stub...
Running stub...
Stub running...
Changing baud rate to 921600
Configuring flash size...
Flash will be erased from 0x00000000 to 0x00003fff...
Flash will be erased from 0x00008000 to 0x00008fff...
Flash will be erased from 0x0000e000 to 0x0000ffff...
Flash will be erased from 0x00010000 to 0x00058fff...
Compressed 13216 bytes to 9528...
Writing at 0x00000000... (100 %)
Wrote 13216 bytes (9528 compressed) at 0x00000000 in 0.2 seconds (effective 465.3 kbit/s)...
Hash of data verified.
Compressed 3072 bytes to 146...
Writing at 0x00008000... (100 %)
Wrote 3072 bytes (146 compressed) at 0x00008000 in 0.0 seconds (effective 612.7 kbit/s)...
Hash of data verified.
Compressed 8192 bytes to 47...
Writing at 0x0000e000... (100 %)
Wrote 8192 bytes (47 compressed) at 0x0000e000 in 0.1 seconds (effective 731.6 kbit/s)...
Hash of data verified.
Compressed 298576 bytes to 162648...
Writing at 0x00010000... (10 %)
Writing at 0x0001a1ed... (20 %)
Writing at 0x000245fb... (30 %)
Writing at 0x0002a32c... (40 %)
Writing at 0x00031670... (50 %)
Writing at 0x0003856f... (60 %)
Writing at 0x0003e7ce... (70 %)
Writing at 0x00044b12... (80 %)
Writing at 0x0004a811... (90 %)
Writing at 0x00052866... (100 %)
Wrote 298576 bytes (162648 compressed) at 0x00010000 in 2.5 seconds (effective 973.9 kbit/s)...
Hash of data verified.

Hard resetting via RTS pin...

Still must Press RESET to go…
Serial monitor output here…

Build:Feb  7 2021
Saved PC:0x420157fe
mode:DIO, clock div:1
entry 0x403cc710

Power ON 
 Program C:\Users\Dude\AppData\Local\Temp\.arduinoIDE-unsaved2023827-1328-1aj42wj.qajf\sketch_sep27a\sketch_sep27a.ino compiled on Sep 27 2023 at 11:01:00

x: 3     y: 0     z: 0 
x: 25786     y: 16896     z: 0 
x: 25786     y: 16896     z: 0 
x: 25786     y: 16896     z: 0 
x: 25786     y: 16896     z: 0 

Hi. It works! Thanks JP

1 Like