#include <LiquidCrystal_I2C.h>
#include <Keypad.h>
LiquidCrystal_I2C LCD(0x27,16,2);
const byte numRows = 4;
const byte numCol = 4;
byte datacount=0;
char Keymap[numRows][numCol]=
{
{'1','2','3','A'},
{'4','5','6','B'},
{'7','8','9','C'},
{'*','0','#','D'}
};
byte rowpin[numRows] = {10,9,8,7};
byte colpin[numCol] = {6,5,4,3};
//Keypad CustomKeypad = Keypad(maKeKeymap(Keymap),rowpin,colpin numRows,numClo)
Keypad customKeypad = Keypad(makeKeymap(Keymap),rowpin,colpin,numRows,numCol);
void setup() {
// put your setup code here, to run once:
LCD.init();
LCD.backlight();
};
void loop() {
// put your main code here, to run repeatedly:
char customKey = customKeypad.getKey();
LCD.setCursor(3,0);
LCD.print("CHEK HERE ");
if(customKey){
LCD.setCursor(datacount,1);
LCD.print(customKey);
datacount++;
}
if (customKey) {
LCD.print(customKey);
};
if(customKey=='D'){LCD.clear();}
if(datacount>8)
{datacount=0;}
};