#include "Wire.h"
#include "LiquidCrystal_I2C.h"
LiquidCrystal_I2C lcd(0x27, 16, 2);
// Make custom characters:
byte Heart[] = {
B00000,
B01010,
B11111,
B11111,
B01110,
B00100,
B00000,
B00000
};
void setup() {
lcd.init(); // Initialize the LCD
lcd.backlight(); // Turn on the backlight
lcd.createChar(0, Heart); // Create a new heart character
lcd.clear(); // Clears the LCD screen
}
void loop() {
String message = "Live it up";
lcd.clear(); // Clear the LCD
lcd.setCursor(0, 0); // Set cursor to the first row
delay(900);
// Print each character of the message
for (int i = 0; i < message.length(); i++) {
lcd.print(message[i]);
delay(200); // Delay between each character
}
// Display the heart character after the last letter
lcd.write(byte(0));
delay(1500); // Delay to display the heart for a while
// Scroll the text to the left
for (int i = 0; i < message.length(); i++) {
lcd.scrollDisplayLeft();
delay(150); // Delay to control the scrolling speed
}
}