Professional Documents
Culture Documents
Untitled 2
Untitled 2
Untitled 2
h>
#include <Keypad.h>
const int rs = 12, en = 11, d4 = 9, d5 = 8, d6 = 7, d7 = 6;
const byte rows = 4;
const byte cols = 4;
char x, y, z;
char oper;
char customkey;
// these are arrays just to configur eouyr keypad
char hexakeys[rows][cols]= {
{'1','2','3','+'},
{'4','5','6','-'},
{'7','8','9','*'},
{'*','0','#','/'},
};
// how our keypad is connected to arduino
byte rowpins[rows] = {A0,A1,A2,A3};
byte colpins[cols] = {A4,A5,2,3};
void loop() {
lcd.setCursor(0, 0);
lcd.print("what is the 1st No");
x = customKeypad.getKey();
if(x != )
lcd.clear();
Serial.print(x);
// lcd.print(x);
// lcd.print(y);
// lcd.print(oper);
lcd.print(z);
delay(5000);
// lcd.setCursor(0, 0);
// lcd.print("Your answer is ");
// lcd.setCursor(0, 1);
// lcd.print(z);
// delay(2000);
// lcd.clear();
}
/* {"1","2","3","A"},
{"4","5","6","B"},
{"7","8","9","C"},
{"*","0","#","D"},*/