#include <Wire.h>
#include <LiquidCrystal_I2C.h>
// Initialize the LCD with the I2C address
// Set the LCD address to 0x27 for a 16x2 display
LiquidCrystal_I2C lcd(0x27, 16, 2);
// Array of lyrics
String lyrics[] = {
"Twinkle, twinkle,",
"little star",
"How I wonder",
"what you are!"
};
int totalLines = sizeof(lyrics) / sizeof(lyrics[0]);
int currentLine = 0;
void setup() {
lcd.begin(16, 2); // Initialize the LCD
lcd.backlight(); // Turn on the backlight
lcd.clear(); // Clear the display
}
void loop() {
lcd.clear(); // Clear the display
lcd.setCursor(0, 0); // Set cursor to the first line
lcd.print(lyrics[currentLine]); // Print the current line of lyrics
// Move to the next line after delay
delay(2000); // Delay for 2 seconds (adjust as needed)
currentLine++; // Go to the next line
// If we've reached the end of the lyrics, start over
if (currentLine >= totalLines) {
currentLine = 0;
}
}