#include <LiquidCrystal_I2C.h>
// Create an instance of the LCD
LiquidCrystal_I2C lcd(0x27, 16, 2); // I2C address, 16 columns, 2 rows
// Define the custom character (heart)
byte heart[8] = {
0b00000, // row 0
0b01010,
0b11111,
0b11111,
0b01110,
0b00100,
0b00000,
0b00000
};
void setup() {
lcd.init(); // Initialize the LCD
lcd.backlight(); // Turn on the backlight
// Create the custom character at location 0
lcd.createChar(0, heart);
// Set the cursor to the first column of the first row
lcd.setCursor(0, 0);
lcd.print("Custom Char:");
// Set the cursor to the first column of the second row
lcd.setCursor(0, 1);
lcd.write(byte(0)); // Display the custom character
}
void loop() {
// Nothing to do here
}