#include <LiquidCrystal_I2C.h>
#include <Wire.h>
#include <Keypad.h>
LiquidCrystal_I2C lcd(0x27, 16, 2);
const int C = 4;
const int R = 4;
char keys[R][C] = {
{'1', '2', '3', '+'},
{'4', '5','6','-'},
{'7','8','9','x'},
{'.', '0', '=', '/'}
};
byte rpins[R] = {13, 12, 11, 10};
byte cpins[C] = {9, 8, 7, 6};
Keypad keypad = Keypad(makeKeymap(keys), rpins, cpins, R, C);
void setup()
{
// put your setup code here, to run once:
lcd.init();
lcd.backlight();
}
void loop()
{
// put your main code here, to run repeatedly:
lcd.setCursor(0,0);
char key = keypad.getKey();
if (key)
lcd.print(key);
}