#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27, 16, 2); // I2C address 0x27, 16 column and 2 rows
byte heart[8] = {
0b00000,
0b01010,
0b11111,
0b11111,
0b01110,
0b00100,
0b00000,
0b00000
};
byte dot[8] = {
0b00000,
0b01110,
0b11111,
0b11111,
0b11111,
0b01110,
0b00000,
0b00000
};
byte fun[8] = {
0b00100,
0b01010,
0b10001,
0b10001,
0b10001,
0b01110,
0b00000,
0b00000
};
byte arrow[8] = {
0b00100,
0b00110,
0b00101,
0b00101,
0b00100,
0b00100,
0b11100,
0b11100
};
void setup()
{
lcd.init(); // initialize the lcd
lcd.backlight();
}
void loop()
{
lcd.setCursor(3, 0); // move cursor to (2, 0)
lcd.print("Hello Drum");
lcd.createChar(0, heart); // create a new custom character
lcd.createChar(1, dot); // create a new custom character
lcd.createChar(2, fun); // create a new custom character
lcd.createChar(3, arrow); // create a new custom character
lcd.setCursor(3, 1);
lcd.write((byte)3); // print the custom char at (2, 0)
lcd.write((byte)1); // print the custom char at (2, 0)
lcd.write((byte)2); // print the custom char at (2, 0)
lcd.write((byte)0); // print the custom char at (2, 0)
lcd.print("CS");
lcd.write((byte)0); // print the custom char at (2, 0)
lcd.write((byte)2); // print the custom char at (2, 0)
lcd.write((byte)1); // print the custom char at (2, 0)
lcd.write((byte)3); // print the custom char at (2, 0)
}