The Seven Segment Display and its TM1637 controller
Line: 49 to 49
The job will be to find out which column makes a connection to which row in order to find out which switch is closed. This can be done by connecting e.g. the 4 row pins to GPIO outputs and the 4 column pins to GPIO inputs with pull-ups.
Set the first row pin to low and check on each column pin if you read a zero. If you do, you have found the switch closed. If not, continue the same procedure on the other row pins.
Added:
> >
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