Touch UI example


#1

Anyone have an example of a Touch/Graphical UI where someone can click on a button drawn on the screen, and fire off some code. This would be a fun extension to the T-Deck or any touch enabled display.

I’m thinking a tutorial for a remote control where you click on buttons and it fires off emails/wifi api calls/ or logging of sensor data might be fun. Or list out mp3s on your sdcard and play them. I got mp3s playing on the t-deck in the past, but the library wasn’t compatible with the one that uLisp uses. If memory served one used C++ style calls while the other was C.


#2

There is an example of a set of functions for working with the touch panel:

https://github.com/molnija2/uLisp-touchscreen-example


#3

Some headers and libraries need to be included.

#if defined(ESP32_2432S028R)

#if defined(touchscreen_support)

#include <SPI.h>
#include <TFT_Touch.h> // Touchscreen driver chip

#define XPT2046_IRQ 36
#define XPT2046_MOSI 32
#define XPT2046_MISO 39
#define XPT2046_CLK 25
#define XPT2046_CS 33
TFT_Touch tft_touch = TFT_Touch(XPT2046_CS, XPT2046_CLK, XPT2046_MOSI, XPT2046_MISO) ;

#endif // TOUCHSCREEN_DRIVERS
#endif // ESP32_2432S028R