I chose to use the raw values returned from the web4robot i2c display as a model for all the keypads.
A normal keypad is laid out
12 Key (4x3)
1 | 2 | 3 |
4 | 5 | 6 |
7 | 8 | 9 |
* | 0 | # |
16 Key (4x4)
1 | 2 | 3 | A |
4 | 5 | 6 | B |
7 | 8 | 9 | C |
* | 0 | # | D |
Key Pressed | Value returned by keypad() |
---|---|
1 | 1 |
2 | 2 |
3 | 3 |
A | 4 |
4 | 5 |
5 | 6 |
6 | 7 |
B | 8 |
7 | 9 |
8 | 10 |
9 | 11 |
C | 12 |
* | 13 |
0 | 14 |
# | 15 |
D | 16 |