cancel
Showing results for 
Search instead for 
Did you mean: 

How to interface multiple buttons (custom keypad with 12 keys) with touchGFX on a STM32h743bi (320x240) custom board?

HR M.1
Associate II

Hi Team,

0693W000008vsXFQAY.pngas shown above image, I need to implement custom keyboard through hardware buttons,

example if press first button at one time 'A' should display, if press continuous two times 'B' should display ,and .i need to display every button values in the text editor.

3 REPLIES 3
Romain DIELEMAN
ST Employee

Hi,

I guess you could do it with just a loop where you wait for a number of ticks before actually displaying a letter: you for example wait 0.5s, if the same button is pressed then you wait another half second and change the letter it would have displayed, and same for third time, fourth, ...

/Romain

HP
Senior III

When pressing a button you activate a counter which is decreased automatically. if you have another keypress on the same key within that timeframe you have detected a doublepress. reset the timer and if you detect at third or a fourth press you act accordingly.

If the next keypress happens within the timeout but is coming from another button - well, then you know that the user pressed something else and you know that you're done 🙂

I think this is pretty similar to what Romain proposes.

The approach is similar no matter if you're reading hardware buttons or buttons on screen.

MM..1
Chief II

Very simpler is use touchscreen display, but when you cant, simply create task for control hw keyboard and to touchgfx send only valid events...