// #include <LiquidCrystal.h>
// const int RS = 9,EN = 8, D7= 7, D6=6, D5=5, D4=4;
// LiquidCrystal lcd(RS,EN,D4,D5,D6,D7);
// void setup() {
// // put your setup code here, to run once:
// lcd.begin(16,2);
// lcd.setCursor(0,0);
// lcd.print("Sub");
// lcd.setCursor(1,3);
// lcd.print("Homie");
// }
// void loop() {
// // put your main code here, to run repeatedly:
// delay(1000);
// for(int i=0;i<10;i++){
// lcd.clear();
// lcd.setCursor(0,0);
// lcd.print(i);
// delay(1000);
// }
// lcd.clear();
// lcd.print("BOOM!");
// }
#include <LiquidCrystal.h>
#include <Keypad.h>
const int ROW_NUM = 4;
const int COLUMN_NUM = 4;
const char keys[ROW_NUM][COLUMN_NUM] = {
{'1','2','3','A'},
{'4','5','6','B'},
{'7','8','9','C'},
{'*','0','#','D'}
};
byte row_pins[ROW_NUM] = {13,12,11,10};
byte column_pins[COLUMN_NUM] = {3,2,1,0};
Keypad keypad = Keypad(makeKeymap(keys),row_pins,column_pins,ROW_NUM,COLUMN_NUM);
const int RS = 9, EN=8, D7=7, D6=6, D5=5, D4=4;
LiquidCrystal lcd(RS,EN,D4,D5,D6,D7);
int column = 0;
int row = 0;
void setup(){
lcd.begin(16,2);
}
void loop(){
char key = keypad.getKey();
if(key){
lcd.setCursor(column,row);
lcd.print(key);
if(column != 15){
column++
}
else{
row = row == 0 ? 1 : 0;
column = 0;
}
}
}