#include <LiquidCrystal_I2C.h>
#include <Wire.h>
#include <Keypad.h>
LiquidCrystal_I2C lcd(0x27,16,2);
const byte filas = 4;
const byte columnas = 4;
byte pinesfilas[] = {16,17,18,19};
byte pinescolumnas[] = {6,7,8,9};
char teclas [4][4]= {{'1','2','3','A'},
{'4','5','6','B'},
{'7','8','9','C'},
{'*','0','#','D'}};
Keypad teclado = Keypad (makeKeymap(teclas),pinesfilas,pinescolumnas,filas,columnas);
void setup()
{
lcd.init();
lcd.backlight();
lcd.begin(16, 2);
lcd.print(" TECLA ");
}
void loop()
{
char tecla_presionar = teclado.getKey();
if (tecla_presionar){
lcd.setCursor(3,1);
lcd.print (tecla_presionar);
}
}