Uno interfacing to system with scanned keypad

dc42:

Paul__B:

dc42:
If it's a 4x4 keypad, then you don't need all 8 ways of the 4051, you only need 4 ways. So you only need to drive 2 of the select lines of each 4051. Plus one of the inhibit pins (or both connected together) so that you also have the state of no key pressed. So you only need 5 Arduino pins in total.

He did spec a 4 by 8 matrix - not the earlier system described in the video above.

OK, so 6 pins needed then (3 for one 4051, 2 for the other, and one common inhibit) - assuming he needs to simulate pressing all 32 keys.

Actually, the system in the video above DOES use an eight line by four line keypad matrix, but with many of the intersections not occupied by keys. The reason for this odd arrangement is that the eight lines are also used as drive-low lines for the common cathode terminals of the eight seven segment displays. And look again - there are actually 20 keys on the keypad, not 16. They are more widely spaced across than they are deep, in order to put them in the same positions as the original membrane keypad keys were.