Close

Code Cleanup

A project log for TFT Touch Keypad (3x5)

The project uses the Makerfabs-ESP32-S3-SPI-TFT-with-Touch board to produce a Touch-Deck

michael-otooleMichael O'Toole 09/08/2023 at 11:200 Comments

Code has been reworked...

First we load the current Menu image (we always start with menu1), we then read the 15 lines (macros) from the associated Menu File... We wait for the user to press a key and process the Macro text associated line... that's all there to it...


You can designate one of the menu button to load the next menu, another to load the previous and perhaps another to go to home menu. To navigate through all the menus we only need two buttons and one home button for convenience, this still leaves st least 12 buttons on each menu...

In the example code I use Menu5 to control an old DOS player (MpxPlay) but it could be any media device. The Menu has the normal media icons play, next, previous as well as Volume, Bass, Treble, Surround Sound Up/Down, plus many other options...

Making a Menu image is very simple and quick. Simply load the image with the red squares, then import icons for you program/actions and save the image to the SD card. Then make a macro file using a text editor containing the actions you want for the associated image, save file to SD card and plug in the TFT board... Power up the card and that's it...

Discussions