#include <Keypad.h>
const byte row = 4;
const byte col = 4;
char keys[row][col] = {
{'1', '2', '3', 'A'},
{'4', '5', '6', 'B'},
{'7', '8', '9', 'C'},
{'*', '0', '#', 'D'}
};
byte pin_rows[row] = {13, 12, 14, 27};
byte pin_column[col] = {26, 25, 33, 32};
Keypad keypad = Keypad(makeKeymap(keys), pin_rows, pin_column, row, col);
void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
Serial.println("Hello, ESP32!");
}
void loop() {
char key = keypad.getKey();
if (key){
Serial.println(key);
}
}