#include <Keypad.h>
const byte FILAS = 4;
const byte COLUMNAS = 4;
char tecladito[FILAS][COLUMNAS] = {
{ '1', '2', '3', 'A' },
{ '4', '5', '6', 'B' },
{ '7', '8', '9', 'C' },
{ '*', '0', '#', 'D' }
};
byte pinesFil[FILAS] = { 9, 8, 7, 6 };
byte pinesCol[COLUMNAS] = {5, 4, 3, 2};
Keypad teclado = Keypad(makeKeymap(tecladito), pinesFil, pinesCol, FILAS, COLUMNAS);
void setup() {
Serial.begin(9600);
}
void loop() {
char tecla = teclado.getKey();
delay(100);
if (tecla != 0) {
Serial.print("La tecla ingresada es ");
Serial.println(tecla);
}
}