improved key scan further:added reboot possibility by input of # times pin length
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user