I made the connections as follows:
Row 1 |
D7: GPIO 23 |
Row 2 |
D6: GPIO 19 |
Row 3 |
D5: GPIO 18 |
Row 4 |
D0: GPIO 26 |
Col 1 |
D4: GPIO 16 on WROVER: GPIO 25 with patch to D4 on CPU board |
Col 2 |
D3: GPIO 17 on WROVER: GPIO 4 with patch to D3 on CPU board |
Col 3 |
D2: GPIO 21 |
Col 4 |
D1: GPIO 22 |
Exercise 1:
Scan the keyboard in intervals of 100 ms and print the key that is pressed. This will result in printing the key as long as it is pressed.
Exercise 2:
Wait until the key is released and only the print the key. This will result of a single key value for each button press.
Exercise3:
Read the keypad in an interrupt driven routine. Keep the pressed keys in a circular buffer. Add the following methods:
- available: returns true if at least 1 character is in the buffer
- read: read a character and remove it from the circular buffer
- status: return an overrun error if the circular buffer is full and a pressed key has been missed
- flush: clear the circular buffer
|