/*Write a program to interface LCD and
keypad with Arduino board and display the key
pressed from keypad on LCD.*/
#include <LiquidCrystal.h>
#include <Keypad.h>
byte ROWS=4;
byte COLS=3;
char keys[ROWS][COLS]={
{'1','2','3'},
{'4','5','6'},
{'7','8','9'},
{'#','0','*'}
};
keypad keypad =keypad(makekeymap(keys)),rPins,cPins,ROWS,COLS);
void setup() {
Serial.begin(9600);
int rs=12,en=11,d4=5,d5=4,d6=3,d7=2;
LiquidCrystal lcd(rs,en,d4,d5,d6,d7);
lcd begin(16,2);
lcd print("hello");
// put your setup code here, to run once:
}
void loop() {
// put your main code here, to run repeatedly:
char key=keypad.getkey();
if(key!=NO_KEY)
Serial.println(println(key);
);
lcd.setCursor(0,1);
}