mirror of https://github.com/JorjBauer/aiie.git
workaround for bug in Keypad library: need to set the pull-ups earlier, so the first reading isn't bad
This commit is contained in:
parent
d1f42a8771
commit
fc805b57e2
|
@ -81,6 +81,12 @@ static uint8_t shiftedNumber[] = { '<', // ,
|
||||||
|
|
||||||
TeensyKeyboard::TeensyKeyboard(VMKeyboard *k) : PhysicalKeyboard(k)
|
TeensyKeyboard::TeensyKeyboard(VMKeyboard *k) : PhysicalKeyboard(k)
|
||||||
{
|
{
|
||||||
|
// Need to set the rows to be pull-ups early, so the pullups have
|
||||||
|
// time to settle -- otherwise we get a phantom set of keypresses
|
||||||
|
// on startup for all the keys in the first column
|
||||||
|
for (byte i=0; i<ROWS; i++) {
|
||||||
|
pinMode(rowsPins[i], INPUT_PULLUP);
|
||||||
|
}
|
||||||
keypad.setDebounceTime(10);
|
keypad.setDebounceTime(10);
|
||||||
|
|
||||||
leftShiftPressed = false;
|
leftShiftPressed = false;
|
||||||
|
|
Loading…
Reference in New Issue