#include <Wire.h>
#include <LiquidCrystal_I2C.h>
// Inisialisasi LCD 20x4 dengan alamat I2C 0x27
LiquidCrystal_I2C lcd(0x27, 20, 4);
// Lirik lagu dibagi per 4 baris untuk LCD 20x4
const char* lyrics[][4] = {
{"tak genggem", "tanganmu", "tak elus", "pipimu"},
{"sumebyar", "jantungku", "koyo mandek", "ora mlaku"},
{"tresnoku yo mung", "kowe", "ra ono liyane", ""},
{"mugo dhewe", "bahagia", "selawase", ""}
};
const int lyricCount = sizeof(lyrics) / sizeof(lyrics[0]);
// Delay per huruf (ms)
const int charDelay = 100;
// Delay setelah satu tampilan bait selesai (ms)
const int frameDelay = 2000;
void setup() {
lcd.init();
lcd.backlight();
}
void loop() {
for (int i = 0; i < lyricCount; i++) {
lcd.clear();
// Tampilkan semua 4 baris per huruf
for (int row = 0; row < 4; row++) {
lcd.setCursor(0, row);
printTypingEffect(lyrics[i][row]);
}
delay(frameDelay);
}
}
// Fungsi untuk menampilkan teks per huruf dengan efek ketik
void printTypingEffect(const char* text) {
for (int i = 0; text[i] != '\0'; i++) {
lcd.print(text[i]);
delay(charDelay);
}
}