#include <Keypad.h>
const byte COLS = 5;
const byte ROWS = 5;
char hexaKeys[ROWS][COLS] =
{
{'O','N','M','L','K'},
{'J','I','H','G','F'},
{'E','D','C','B','A'},
{'9','8','7','6','5'},
{'4','3','2','1','0'},
};
byte colPins[COLS] = {7, 8, 9, 10, 11};
byte rowPins[ROWS] = {2, 3, 4, 5, 6};
Keypad pad = Keypad(makeKeymap(hexaKeys), rowPins, colPins, ROWS, COLS);
void setup()
{
Serial.begin(9600);
Serial.println("Connected");
pad.setHoldTime(100);
pad.setDebounceTime(50);
}
void loop()
{
char key = pad.getKey();
// pad.getState();
if (key)
{
Serial.println(key);
}
}