#include <Keypad.h>
#include <LiquidCrystal.h>
const int rs = 15, en = 2, d4 = 0, d5 = 4, d6 = 16, d7 = 17;
LiquidCrystal lcd(15, 2, 0, 4, 16, 17);
const byte ROWS = 4; //four rows
const byte COLS = 3; //three columns
char keys[ROWS][COLS] = {
{'1','2','3'},
{'4','5','6'},
{'7','8','9'},
{'*','0','#'},
};
byte rowPins[ROWS] = {23, 22, 3, 21}; //connect to the row pinouts of the keypad
byte colPins[COLS] = {19, 18, 5}; //connect to the column pinouts of the keypad
Keypad keypad = Keypad( makeKeymap(keys), rowPins, colPins, ROWS, COLS );
int cursorColumn = 0;
void setup(){
Serial.begin(9600);
lcd.begin (16, 2);
lcd.setCursor(0, 0);
lcd.print("Zeynep");
lcd.setCursor(0, 1);
lcd.print("Tufek");
delay(3000);
lcd.clear();
}
void loop(){
char key = keypad.getKey();
if (key) {
lcd.setCursor(0, 0);
lcd.print("YOZGAT");
lcd.setCursor(cursorColumn, 1);
lcd.print(key);
cursorColumn++;
if(cursorColumn == 16)
{
lcd.clear();
cursorColumn = 0;
}
}
}