#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd (0x27, 16, 2);//0x27 adalah alamat I2C, 16 adalah jumlah kolom,
//2 adalah jumlah baris
byte icon1[8] = {
0b00000,
0b00001,
0b00011,
0b00011,
0b00111,
0b01111,
0b01111,
0b11111};
byte icon2[8] = {
0b00010,
0b10010,
0b11010,
0b11010,
0b11110,
0b11110,
0b11110,
0b11111 };
byte icon3[8] = {
0b11111,
0b11111,
0b11100,
0b11100,
0b11100,
0b11100,
0b11100,
0b11100};
byte icon4[8] = {
0b11111,
0b11111,
0b11111,
0b10001,
0b10001,
0b10001,
0b11111,
0b11111 };
void setup() {
lcd.init();
lcd.backlight();
lcd.begin(16, 2);
}
void loop(){
lcd.createChar(0, icon1);
lcd.setCursor(1, 0);
lcd.write((byte)0);
lcd.createChar(1, icon2);
lcd.setCursor(2, 0);
lcd.write((byte)1);
lcd.createChar(2, icon3);
lcd.setCursor(1, 1);
lcd.write((byte)2);
lcd.createChar(3, icon4);
lcd.setCursor(2, 1);
lcd.write((byte)3);
lcd.setCursor(4, 0);
lcd.print("Rumahku");
lcd.setCursor(4, 1);
lcd.print("Istanaku");
}