Close
0%
0%

TFT Touch Keypad (3x5)

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

Similar projects worth following
Original description moved to comment section...

This projects aims to simplify the process of creating a TFT based Macro Keyboard / Stream Deck, without the need for special GUI software to generate the screen and macro code. To this end we follow three simple steps...

Step 1: Create a bmp image containing 15 icons (the buttons)...
Step 2: Create a text file of 15 line of text (the macros)...
Step 3: Save files to an SD card, insert the SD card into the board and power up...

You can have as many menus as you require. each capable of loading addition menus.

As we load a menu image we read the associated menu macro file (to associate the correct menu button to the corresponding macro). In the main loop we watch for touch button actions and pass the associated macro to the computer...

Once you determine the number of Menus and edited the ino file, you would never have to reprogram the board again. Future edits could be achieved by editing the files on the SD.

Example menu text file: (exactly as you type it)

freecad
[T]/usr/bin/flatpak run --branch=stable --arch=x86_64 --command=kicad --file-forwarding org.kicad.KiCad
/opt/sublime_text/sublime_text
/home/Mike/Downloads/arduino-1.8.19/arduino
[T]ls -l
[LA]3
/usr/share/playonlinux/playonlinux --run 'Fireworks'
firefox
xfce4-terminal
kcalc
[RA]4
meld
[NEXT]
/home/Mike/AppImages/Stellarium.AppImage
[PREV]

menu1 - 377.00 bytes - 09/14/2023 at 15:38

Download

menu5 - 71.00 bytes - 09/14/2023 at 15:21

Download

  • 1 × Makerfabs-ESP32-S3-SPI-TFT-with-Touch The main Board

  • Source Code etc.

    Michael O'Toole11/14/2023 at 06:15 0 comments

    Code and STL files included... see project link...

  • Notes on Menu (macro)​ files...

    Michael O'Toole09/14/2023 at 15:53 0 comments

    Notes on Menu (macro) files...

    • Menus must be named in sequence from menu1 to menu99...
    • Menus can not contain empty lines...
    • Menus can not have more than 15 lines...
    • Menus can not contain comments...

    In theory you should be able to add comments/text after the last line (assuming all 15 lines are present).

    In testing I have based everything on 5 menus, this allows me to load the last menu from the first menu round-robin... Set the variable for the last menu (MAXMENUS,) to whatever yours is. If you have three menus then set this to 3, that way you can safely load the last menu from the first menu in a round-robin fashion. 1,2,3,4,5,1,2,3 etc... 5,4,3,2,1,5,4 etc...

  • menu5 (sample menu for MpxPLay)

    Michael O'Toole09/14/2023 at 15:23 0 comments

    [<]
    [S+]
    [S-]
    [P]
    [B-]
    [B+]
    [>]
    [T-]
    [T+]
    [MU]
    [x]
    [y]
    [CF]
    [z]
    [HOME]

  • Case for Project (Macro Keypad / Stream Deck)

    Michael O'Toole09/14/2023 at 14:41 0 comments

    A case for the project can be found over at thingiverse ...

  • Stack issue fixed!

    Michael O'Toole09/12/2023 at 12:23 0 comments

    Stack issue (reboot after x processes), fixed... Thanks to MicroController over at ESP32 Forums.

    My issue was (infinite recursion)... rewrote the code... Hope I didn't speak too soon ;) but it's looking good.

  • Code Cleanup

    Michael O'Toole09/08/2023 at 11:20 0 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...

  • Stack Issue

    Michael O'Toole09/08/2023 at 11:05 1 comment

    Looking for help with Stack issue...

    To begin I best point out the project was built using sample code. Somewhere in this code or my implementation of it, the stack reduces on each key processed and eventually the board resets. I added code to report the stack size after each process and it is being reduced and eventually reboots, ( something is being pushed to the stack but not popped)...

    It's not major (if you don't mind the board resetting every so often), but it has to be fixed... any help appreciated...

    The touch detection should probably be an interrupt (instead of inside a loop), this may account for stack issue...

View all 7 project logs

Enjoy this project?

Share

Discussions

Michael O'Toole wrote 09/16/2023 at 16:45 point

Rewrite old description...

We start with a 480px by 320px background image, it consists of 16 button areas (identified by the red outlined squares). Then using an image editor, we edit a  Grid480x320.bmp file and import the desired button icons (64px by 64px images works well) into each of the outlined button icons positions. Once finished, export the final image as menu1.bmp and save to SD card.

Now we need to add a text file named menu1, containing up to fifteen lines of text (macros), these will be triggered when you press the associated button on the display. Menus images are named: menu1.bmp, menu2.bmp, etc... Macros file/text files are named menu1, menu1 etc...

The project uses the Arduino IDE to compile and upload the code, once done, you only need edit the menu text file to change the macro on the SD card. You can have multiple menus each with it's own macro text file, menus can load other menus with [NEXT], [PREV], [HOME] see sample menu text file....

  Are you sure? yes | no

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates