Compilation error TFT_eSPI (Round display Xiao ESP32S3)

Hello!
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,
Nuc.
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”
HTH
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.
Nuc

Hi there,
Nuc
I think the LIB is the issue, “TFT_eSpi lib (2.5.23).”
https://github.com/Bodmer/TFT_eSPI
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”
HTH
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.
code…

// 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:
// https://github.com/Bodmer/TFT_eSPI

// 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) {
 Serial.begin(9600);
  delay(2500);  //relax...Get Ready for serial port
  Serial.println();
  Serial.println();
  Serial.println("Power ON ");  // Let's BEGIN!!
  Serial.println(" Program " __FILE__ " compiled on " __DATE__ " at " __TIME__ );
  Serial.println();

  tft.init();
}

//====================================================================

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());

  delay(250);

}

//====================================================================

OUTPUT…

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" 
esptool.py v4.5.1
Serial port COM3
Connecting...
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
Changed.
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.

Leaving...
Hard resetting via RTS pin...

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

ESP-ROM:esp32c3-api1-20210207
Build:Feb  7 2021
rst:0x15 (USB_UART_CHIP_RESET),boot:0x8 (SPI_FAST_FLASH_BOOT)
Saved PC:0x420157fe
SPIWP:0xee
mode:DIO, clock div:1
load:0x3fcd5810,len:0x438
load:0x403cc710,len:0x918
load:0x403ce710,len:0x25f4
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

Hello !

I am using esp32s3 with same display and i am using the above code.
it show me on the serial like below
x: 0 y: 0 z: 0
x: 0 y: 0 z: 0
x: 0 y: 0 z: 0
x: 0 y: 0 z: 0
x: 0 y: 0 z: 0
x: 0 y: 0 z: 0
x: 0 y: 0 z: 0
x: 0 y: 0 z: 0
x: 0 y: 0 z: 0
x: 0 y: 0 z: 0

What should be the reason ?

Hi there,
Yes You should get the X position, Y position, and Z the press strength (how hard or soft you press)
You need the specific Libs for it to work. Either the TFT_eSPI or the GFX with adafruit touch driver.
Check the compiler output for which you are using and READ the Wiki for the “HOW to” portion.
HTH
GL :slight_smile: PJ

When you get the LIB’s worked out it will work. :v:

Thank you for your response.
I am using this link Using LVGL and TFT for all XIAO Series | Seeed Studio Wiki for libraries. with thisTFT eSPI version Xiao Round display starts showing x,y,z value zero.

Touch hard and soft press both are not effecting. only showing value 0.

x: 0 y: 0 z: 0
x: 0 y: 0 z: 0
x: 0 y: 0 z: 0
x: 0 y: 0 z: 0
x: 0 y: 0 z: 0
x: 0 y: 0 z: 0

Hi there,
Can you post the compiler output, the first 4 lines and the last 20 b4 the uload.
Did you make the necessary edits? and move the round display file to the libs folder?
HTH
GL :slight_smile: PJ