GUIslice drag & drop embedded GUI in C for touchscreen TFT on Arduino, Raspberry Pi, ARM, ESP8266 / ESP32 / M5stack using Adafruit-GFX / TFT_eSPI / UTFT / SDL
Hi,
I would like to bring some updates to the topic discussed in #130 as these ILI9341 parallel displays are quite accessible, affordable and the touch functionality is now working with Bodmer's
TFT_eSPI library, via a modified Adafruit´s touch library. Unfortunately, I still can not make the GUIslice´s touch functionality to work.
The shield I am using is identified as "tftlcd for arduino uno (spiflash)." Main specifications are:
TFT 2.4", ILI9341 driver, parallel eight bit interface, SD interface via SPI, and touch
functionality via 4-wire (simple/analog) touch driver.
The TFT and touch are working with the TFT_eSPI (Setup14_ILI9341_Parallel.h) and MCUFRIEND_kbv libraries, with the connections described in the following link, for the WeMos D1 R32 board. These connections are based on Bodmer's description, but an extra one is made. This is the library forked from the Adafruit original, by s60sc:
https://github.com/s60sc/Adafruit_TouchScreen
Once this touch library has been downloaded, the TouchScreen.h file needs to be modified for defining the ESP32_WIFI_TOUCH and the pines used:
XM 15 analog input pin connected to LCD_RS
YP 4 analog input pin connected to LCD_WR
There is a discrepancy with the YP connection reported by Benton on #130. Same as him, I tested this setup with the WeMos Board and a ESP32 DevKit Doit, having a working display and touch functionality with the libraries mentioned before.
Now for the GUIslice library, in the GUIslice_config.h, I am including the esp-tftespi-default-simple.h file. Here, in section 4A, I declared the touch pins connections as follows:
#define ADATOUCH_PIN_YP 4#define ADATOUCH_PIN_XM 15#define ADATOUCH_PIN_YM 14#define ADATOUCH_PIN_XP 27
Example file ex01 runs fine; ex02 shows the button but there is no touch functionality as there is no message to the serial monitor.
I tried uncommenting DBG_TOUCH in Section 10 of the esp-tftesp-default-simple.h and got touch response! This is the data sent to the serial monitor:
DBG: remapX: (3632,3618,3639,0,239)
DBG: remapY: (3622,3635,3623,0,319)
DBG: PreRotate: x=159 y=319
DBG: RotateCfg: remap=1 nSwapXY=1 nFlipX=0 nFlipY=1
DBG: Touch Press=1792 Raw[3632,3622] Out[319,80]
Trk: (319,80) P=1792 : TouchDown
Hi, I would like to bring some updates to the topic discussed in #130 as these ILI9341 parallel displays are quite accessible, affordable and the touch functionality is now working with Bodmer's TFT_eSPI library, via a modified Adafruit´s touch library. Unfortunately, I still can not make the GUIslice´s touch functionality to work.
The shield I am using is identified as "tftlcd for arduino uno (spiflash)." Main specifications are: TFT 2.4", ILI9341 driver, parallel eight bit interface, SD interface via SPI, and touch functionality via 4-wire (simple/analog) touch driver.
A good description (in Spanish, as I live in Mexico) of a local provider is: https://uelectronics.com/producto/shield-display-tft-2-4-touch-para-arduino-uno-mega/ Local prices vary from 11.81 to 15.42 USD.
The TFT and touch are working with the TFT_eSPI (Setup14_ILI9341_Parallel.h) and MCUFRIEND_kbv libraries, with the connections described in the following link, for the WeMos D1 R32 board. These connections are based on Bodmer's description, but an extra one is made. This is the library forked from the Adafruit original, by s60sc: https://github.com/s60sc/Adafruit_TouchScreen
Once this touch library has been downloaded, the TouchScreen.h file needs to be modified for defining the ESP32_WIFI_TOUCH and the pines used: XM 15 analog input pin connected to LCD_RS YP 4 analog input pin connected to LCD_WR
There is a discrepancy with the YP connection reported by Benton on #130. Same as him, I tested this setup with the WeMos Board and a ESP32 DevKit Doit, having a working display and touch functionality with the libraries mentioned before.
Now for the GUIslice library, in the GUIslice_config.h, I am including the esp-tftespi-default-simple.h file. Here, in section 4A, I declared the touch pins connections as follows:
#define ADATOUCH_PIN_YP 4
#define ADATOUCH_PIN_XM 15
#define ADATOUCH_PIN_YM 14
#define ADATOUCH_PIN_XP 27
Example file ex01 runs fine; ex02 shows the button but there is no touch functionality as there is no message to the serial monitor.
I tried uncommenting DBG_TOUCH in Section 10 of the esp-tftesp-default-simple.h and got touch response! This is the data sent to the serial monitor: DBG: remapX: (3632,3618,3639,0,239) DBG: remapY: (3622,3635,3623,0,319) DBG: PreRotate: x=159 y=319 DBG: RotateCfg: remap=1 nSwapXY=1 nFlipX=0 nFlipY=1 DBG: Touch Press=1792 Raw[3632,3622] Out[319,80] Trk: (319,80) P=1792 : TouchDown
DBG: Touch End =0 Raw[3632,3622] ***** DBG: remapX: (3632,3618,3639,0,239) DBG: remapY: (3622,3635,3623,0,319) DBG: PreRotate: x=159 y=319 DBG: RotateCfg: remap=1 nSwapXY=1 nFlipX=0 nFlipY=1 DBG: Touch Press=0 Raw[3632,3622] Out[319,80] Trk: (319,80) P=0 : TouchUp
Hopefully, we could have the touch working with this great GUIslice library. Thank you, Alex