improved key scan further:added reboot possibility by input of # times pin length

This commit is contained in:
2025-10-06 17:08:02 +02:00
parent 637c85e885
commit 1d35684c53
2 changed files with 18 additions and 4 deletions
@@ -82,10 +82,14 @@ bool Keypad::getKeys() {
// Private : Hardware scan
void Keypad::scanKeys() {
// Re-intialize the row pins. Allows sharing these pins with other hardware.
for (byte r=0; r<sizeKpd.rows; r++) {
pin_mode(rowPins[r],OUTPUT);
pin_write(rowPins[r],HIGH);
}
delayMicroseconds(3); // Let pins settle.
for (byte r=0; r<sizeKpd.rows; r++) {
pin_mode(rowPins[r],INPUT_PULLUP);
}
delayMicroseconds(1); // Let pins settle.
// bitMap stores ALL the keys that are being pressed.
for (byte c=0; c<sizeKpd.columns; c++) {
pin_mode(columnPins[c],OUTPUT);