Keypad
Keypad copied to clipboard
Use `const` for constructor's arguments..
It is better to change this line to:
Keypad(const char *userKeymap, const uint8_t *row, const uint8_t *col, uint8_t numRows, uint8_t numCols);
So the code can support:
const char KEYS[] = {
'1','4','7','*',
'2','5','8','0',
'3','6','9','#',
'A','B','C','D',
};
const uint8_t COLUMN_PINS[] = {9, 8, 7, 6};
const uint8_t ROW_PINS[] = {5, 4, 3, 2};
Keypad keypad = Keypad(KEYS, COLUMN_PINS, ROW_PINS, sizeof(ROW_PINS), sizeof(COLUMN_PINS));