#include <LiquidCrystal_I2C.h>
#include <Keypad.h>
const int BARIS = 4;
const int KOLOM = 4;
char keys[BARIS][KOLOM] =
{ {'1','2','3','A'},
  {'4','5','6','B'},
  {'7','8','9','C'},
  {'*','0','#','D'}
};
byte rowPins[BARIS] = {14, 12, 19, 18};//22,21,19,18 Ganti ke sini
byte colPins[KOLOM] =  {5, 4, 2, 15};
Keypad keypad = Keypad( makeKeymap(keys), rowPins, colPins, BARIS, KOLOM);
LiquidCrystal_I2C lcd(0x27,16,2);
void setup()
{lcd.init();
 lcd.backlight();
}
void loop()
{char key=keypad.getKey();
 lcd.setCursor(0,0);
 lcd.print(" Button Pressed ");
 if (key != NO_KEY)
 {lcd.setCursor(0,1);
  lcd.print(key);
 }
}