I will have at least one 4x4 keypad, most likely two, so yes, a diode matrix might be more suitable. I've never worked with one, I just used code to scan trough the 4 rows one column at a time, not sure if the diode matrix has advantages?
Or maybe I should use one shift register per one 4x4 keypad matrix? i.e. hook up the matrix's 4 row and 4 column pins to the 8 pins on the shift register and then have Arduino code translate the output of the shift register?
The reason for using diodes is that with them, you can handle multiple keys being down at the same time. If you don't care about that, then you can omit the diodes.
To drive a 4x4 matrix you need 4 outputs and 4 inputs, so you can't use a single 8-bit SIPO or PISO shift register.
QuoteThe reason for using diodes is that with them, you can handle multiple keys being down at the same time. If you don't care about that, then you can omit the diodes. Well you can do it without diodes as long as your code checks each row and column one at a time, i.e. row 1 column 1, row 1 column 2, row 1 column 3..... etc.... at least that's how I did it. Of course if you can press, hold and let go of multiple buttons simultaneously faster than the Arduino can run through all the row/column combination you'll have a problem... but can you be that fast?
Does anyone here have a code example (tutorial)?