Component knowledge
4x4 Matrix Keypad
Keypad is a device that integrates a number of keys. As is shown below, a 4x4 Keypad integrates 16 keys:
Like the integration of LED matrix, in 4x4 Keypad each row of keys is connected in with one pin and it is the
same as each column. Such connection can reduce the occupation of processor port. Internal circuit is shown
below.
The usage method is similar to the Matrix LED, namely, uses a row scan or column scanning method to detect
the state of key on each column or row. Take column scanning method as an example, send low level to the
first 1 column (Pin1), detect level state of row 5, 6, 7, 8 to judge whether the key A, B, C, D are pressed. And
then send low level to column 2, 3, 4 in turn to detect whether other keys are pressed. Then, you can get the
state of all keys.