I have the following matrix keypad - enter image description here
I am using this as a sort of controller with my Arduino (Mega2560) but I can't get real multiple inputs to work. I am able to have say two individual keys pressed at a time but after that they overlap with eachother. (Using the Keypad library also).
Here is an illustration of the issue:
If I press the 3 blue buttons and use the getKeys function it thinks that the red one is also pressed. This works when any three or more buttons are pressed that produce a square.
-
That's a very well known issue with matrix keypads. What is your question?ratchet freak– ratchet freak2018年03月17日 21:44:07 +00:00Commented Mar 17, 2018 at 21:44
-
See pcbheaven.com/wikipages/How_Key_Matrices_Works section "The ghosting problem"Maximilian Gerhardt– Maximilian Gerhardt2018年03月17日 21:48:14 +00:00Commented Mar 17, 2018 at 21:48
-
that's just how it works, nothing you can do about it. you might find some 3 button combos are detectable, but certainly not all will be.dandavis– dandavis2018年03月18日 12:53:32 +00:00Commented Mar 18, 2018 at 12:53
1 Answer 1
I have a post about keypad matrices which discusses this issue. The issue with keypads is, that if you don't install diodes, if three keys are pressed the current finds its way around those three keys and it looks like a fourth is pressed.
If you install diodes, like this, the issue goes away:
It can be a little tedious to do, but I managed it the other day with surface mounted diodes.
Keypad with surface-mounted diodes
The above board is different from yours, mine is one with soft switches which I could lift off to get at the board.
Yours looks like it might be almost impossible to cut the tracks and install the diodes. Without them you can press two keys at once without issues. Perhaps that is enough. :)