Error using TFT_ESPI library

@ BODMER
Dear Bodmer, by copying some sketches for ESP32 from the Internet, I am incuding the library "TFT_Espi 2.4.79", which I loaded among the Arduino libraries.
These schetches refer to the "touchscreen", the "setTuoch", the "getTouch", the "touchpad", etc.
Arduino , despite your loaded library gives me error because it does not find these references.
No doubt I am doing something wrong, but what?
Could you give me some advice?
Thanks, Roberto

Post the errors you observe from your IDE to help solve the issue.

Here are the Arduino main error:

C:\Users\lenovo\Desktop\Lavori ESP32\LVGL_TFT\TFT_01\TFT_01.ino: In function 'void my_touchpad_read(lv_indev_drv_t*, lv_indev_data_t*)':
C:\Users\lenovo\Desktop\Lavori ESP32\LVGL_TFT\TFT_01\TFT_01.ino:50:24: error: 'class TFT_eSPI' has no member named 'getTouch'; did you mean 'getColor'?
     bool touched = tft.getTouch( &touchX, &touchY, 600 );
                        ^~~~~~~~
                        getColor
C:\Users\lenovo\Desktop\Lavori ESP32\LVGL_TFT\TFT_01\TFT_01.ino: In function 'void setup()':
C:\Users\lenovo\Desktop\Lavori ESP32\LVGL_TFT\TFT_01\TFT_01.ino:128:5: error: 'lv_demo_widgets' was not declared in this scope
     lv_demo_widgets();            // OK
     ^~~~~~~~~~~~~~~
C:\Users\lenovo\Desktop\Lavori ESP32\LVGL_TFT\TFT_01\TFT_01.ino:128:5: note: suggested alternative: 'lv_clamp_width'
     lv_demo_widgets();            // OK
     ^~~~~~~~~~~~~~~
     lv_clamp_width

exit status 1

Compilation error: 'class TFT_eSPI' has no member named 'getTouch'; did you mean 'getColor'?

Thank you for what you can suggest,
Roberto

Do you change User_Setup.h (in TFT_eSPI map) accordingly the used hardware?

Try Test_Touch_Controller from the example map.

Also, in your setup have you defined the TOUCH_CS pin? Otherwise the touch part of the library will be not included in compilation, reporting the above errors.

Ciao, Ale.

1 Like

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.