Skip to main content
HR M.1
Associate
March 3, 2021
Question

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

  • March 3, 2021
  • 3 replies
  • 1653 views

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.

This topic has been closed for replies.

3 replies

Romain DIELEMAN
ST Employee
March 3, 2021

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_it
Senior II
March 3, 2021

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
Super User
March 3, 2021

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