|
This button matrix contains 3x4 push buttons, making that a total of 12 pushbuttons.
The LEDs simulate a kind of output pin/info
---------------------------------
X1 X2 X3 X4
Y1
Y2
Y3
---------------------------------
By using that pattern, you only have 3+4 outputs, making a total of 7 outputs for 12 buttons
Whenever a button is pressed, the according X and Y outputs are conducting electricity.
That means, if the second button in the third line is pushed, outputs X2 and Y3 are active.
A ribbon cable can connect to these outputs, effectively lowering the amount of outputs needed to collect information about which button is pressed.
A common use for this would be a keypad, if you have the numbers arranged like this:
X1 X2 X3
Y1 1 2 3
Y2 4 5 6
Y2 7 8 9
You'd have 3 X and 3 Y outputs. This means that you'll have 6 output wires and 1 wire for either Vin or GND, depending on whether you have a common anode or cathode:
Example:
W = Wire
W1 W2 W3 W4 W5 W6 W7
X1 X2 X3 Y1 Y2 Y3 Vin
In this configuration, one wire (wire 7) supplies the keypad with electricity while the other return a signal.
____________________________________
I hope this could help some people out and demonstrate the way that most keypads work.
I also cannot guarantee that everything shown in this project is correct, however this is a working way to wire a keypad.
Have a nice day and have fun experimenting!
|