From e8e91a24445d15693af0387e37dbb990fbc20549 Mon Sep 17 00:00:00 2001 From: Jorge Tornero Date: Wed, 26 May 2021 19:35:41 +0200 Subject: [PATCH 1/2] Update keypad.h to allow bigger matrix If your matrix has more than 10 rows the scan is not made properly. Just setting the directive MAPSIZE 10 to 12 allows for two extra rows to be used in the matrix. --- src/Keypad.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Keypad.h b/src/Keypad.h index 0648114..ba60c14 100644 --- a/src/Keypad.h +++ b/src/Keypad.h @@ -67,7 +67,7 @@ typedef struct { } KeypadSize; #define LIST_MAX 10 // Max number of keys on the active list. -#define MAPSIZE 10 // MAPSIZE is the number of rows (times 16 columns) +#define MAPSIZE 12 // MAPSIZE is the number of rows (times 16 columns) #define makeKeymap(x) ((char*)x) From 4731aae23e18920e8d1ae872d266dff5f6872789 Mon Sep 17 00:00:00 2001 From: Jorge Tornero Date: Wed, 26 May 2021 19:39:48 +0200 Subject: [PATCH 2/2] Allow more rows to be used in the keypad If your keypad matrix has more than 10 rows there will be scanning issues. Raising MAPSIZE to 12 allows for two more rows to be used. Theoretically the maximum number of rows should be 16, accounting for 256 possible key values. --- src/Keypad.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Keypad.h b/src/Keypad.h index ba60c14..8f51736 100644 --- a/src/Keypad.h +++ b/src/Keypad.h @@ -81,7 +81,7 @@ class Keypad : public Key { virtual void pin_write(byte pinNum, boolean level) { digitalWrite(pinNum, level); } virtual int pin_read(byte pinNum) { return digitalRead(pinNum); } - uint bitMap[MAPSIZE]; // 10 row x 16 column array of bits. Except Due which has 32 columns. + uint bitMap[MAPSIZE]; // 12 row x 16 column array of bits. Except Due which has 32 columns. Key key[LIST_MAX]; unsigned long holdTimer;