//note for myself -> PLS DONT BE LAZY DONT STOP THE PROJECT
#include<Keypad.h>
#include<LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27, 16, 2); //create an object for lcd
const uint8_t row = 4; //const make var cannot be change. uint8_t take space just 1 byte
const uint8_t colum = 4; //its error for no researn
char keys[row][colum] = {
{"1", "2", "3", "+"},
{"4", "5", "6", "-"},
{"7", "8", "9", "*"},
{"C", "0", "=", "/"}
};
uint8_t rowpin[row] = {9, 8, 7, 6}; //กำหนดขาpin row
uint8_t columpin[colum] = {5, 4, 3, 2}; //กำหนดขาpin colum
Keypad keypads = keypads(makeKeymap(keys), rowpin, columpin, row, colum);
void setup() {
Serial.begin(9600);
lcd.init();
lcd.backlight(); //turn on backlight to using it
}
void loop() {
// put your main code here, to run repeatedly:
char getkey = keypads.getKey();
if (getkey) {
lcd.print(getkey);
}
}
/* todo list
???
*/