Thank you for your donation!


Cloudsmith graciously provides open-source package management and distribution for our project.


Solved: Key matrix buttons GPIO support
#1
I was wondering what's the best way to support key matrix in moode.
I am talking about having many buttons wired in columns and rows instead feeding them the usual two wires to each of them...
I see many commercial receivers faceplates are wired this way when the button count gets bigger than a couple.

This way you can wire a lot of buttons with less wires/GPIOs.

[Image: 4x3-Membrane-Keypad-Working.gif]


And since many receivers usually have a board in the faceplate already wired this way, this makes it easy to use the stock hardware without any mods, plug and play.
I kinda hacked a few python scripts together and it kinda works for a while, then there's some debouncing issue that I still haven't tried to debug, but need to figure the source/licensing before posting it here.

Also while browsing yesterday I found this page, talking about using a device tree overlay instead of the python script in the userland.
Thinking if it could be useful in moode, could it be a better way?

https://blog.gegg.us/2017/08/a-matrix-ke...one-right/
Reply
#2
FYI the dts overlay way works great.
Create the DTS overlay file as the url above shows. 
Compile it with dts script, move it to boot/overlays, load it in boot/config.txt.
Then add the missing key bindings in triggerhappy's media.conf, enable triggerhappy systemctl service and it will all work beautifully.
No moode mods required, nor additional scripts. The system will see the key events natively exactly the same as media keys on a keyboard.
Pi4 1gb - Moode 8.3.9 / 9.1.4
Suptronics X6000 7.1ch HDMI hat
Reply


Forum Jump: