#include <LiquidCrystal.h>
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
struct LyricLine {
String text;
int delayTime;
};
LyricLine lyrics[] = {
{"I'm all alone", 1500},
{"here",500},
{"in my bed", 1500},
{"without you on my mind", 2200},
{"I'm up all day", 1500},
{"til I close", 1400},
{"my eyes", 1500},
{"without you on my mind", 2200},
{"I still hear", 1500},
{"you here", 2500},
{"whispering in my ears", 1500},
{"but when I look into your eyes", 2100},
{"I realize", 1400},
{"you're not real", 2500}
};
int totalLines = 14;
void setup() {
lcd.begin(16, 2);
}
void loop() {
for (int i = 0; i < totalLines; i++) {
lcd.clear();
if (lyrics[i].text.length() <= 16) {
lcd.setCursor(0, 0);
lcd.print(lyrics[i].text);
} else {
for (int j = 0; j <= lyrics[i].text.length() - 16; j++) {
lcd.setCursor(0, 0);
lcd.print(lyrics[i].text.substring(j, j + 16));
delay(150);
}
}
delay(lyrics[i].delayTime);
}
}