salva g wrote:
...and could be pressed any switches i want at the same time? or only
one?
No, think of it as a 4x4 grid, sorta like this.
1 2 3 4
| | | |
--+--+--+--+-- A
| | | |
--+--+--+--+-- B
| | | |
--+--+--+--+-- C
| | | |
--+--+--+--+-- D
| | | |
Where ever there is a + is a button, ----'s (A-D) are the output wires
(four of them) and | | (1-4) are the input wires (four of them)
Now, if line A is high and you press say A3 and B3 then the B line
effectively becomes high as well. If you pressed A3, B3 and B1 down
then your program would "see" A3 and A1 as being pressed. Now if the B
line is pulled low you've just created a short which is why it's always
a good idea to put current limit resistors in series with any output.
You can block this interaction by using diodes, if you want more info
I'd look up "matrix keypad schematic" or something like that online.
It's neat to note that most keyboards for your computer work in a
similar way.
--
Jason Stahls