#include <LiquidCrystal.h>
#include <Keypad.h>
int i = 0, a = 0;
const byte ROWS = 4;
const byte COLS = 4;
char keys[ROWS][COLS] = {
{'A','B','D','U'},
{'Q','M','S','L'},
{'R','W','E',' '},
{'T','Y','U','I'}
};
byte rowPins[ROWS] = {15,14,13,12};
byte colPins [COLS] = {11,10,9,8};
Keypad pad = Keypad(makeKeymap(keys), rowPins, colPins, ROWS, COLS);
const int rs = 2, en = 3, d4 = 4, d5 = 5, d6 = 6, d7 = 7;
LiquidCrystal lcd (rs, en, d4, d5, d6, d7);
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
lcd.begin(16,2);
// lcd.setCursor(4,0);//c0lumm,row
// //lcd.print("Welcome To");
//lcd.print("AJR-IET");
}
void loop() {
// put your main code here, to run repeatedly:
char key = pad.getKey();
if (key){
lcd.setCursor(i,a);
lcd.print(key);
i++;
if(i == 16){
a = 1;
i = 0;
lcd.setCursor(i,1);
lcd.print(key);
// i++;
}
}
}