#include <Keypad.h>
const byte FILAS = 4;
const byte COLUMNAS = 4;
byte filasPines[FILAS] = {13, 12, 14, 27};
byte columnasPines[COLUMNAS] = {26, 25, 33, 32};
char teclas[FILAS][COLUMNAS] = {
{'1', '2', '3', 'A'},
{'4', '5', '6', 'B'},
{'7', '8', '9', 'C'},
{'*', '0', '#', 'D'}
};
Keypad teclado = Keypad(makeKeymap(teclas), filasPines, columnasPines, FILAS, COLUMNAS);
char caracter;
void setup() {
Serial.begin(9600);
}
void loop() {
caracter = teclado.getKey();
if (caracter) {
Serial.println(caracter);
}
}