Moode Forum
Key matrix buttons GPIO support - Printable Version

+- Moode Forum (https://moodeaudio.org/forum)
+-- Forum: moOde audio player (https://moodeaudio.org/forum/forumdisplay.php?fid=3)
+--- Forum: Feature requests (https://moodeaudio.org/forum/forumdisplay.php?fid=8)
+--- Thread: Key matrix buttons GPIO support (/showthread.php?tid=7112)



Key matrix buttons GPIO support - challenge - 11-20-2024

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-keypad-on-a-raspberry-pi-done-right/