#include <Wire.h>
#include <LiquidCrystal_I2C.h>
// Inisialisasi LCD I2C dengan alamat 0x27 dan ukuran 20x4
LiquidCrystal_I2C lcd(0x27, 20, 4);
int typingDelay = 80; // Delay per huruf (ms) - ubah untuk kecepatan typing
// Fungsi untuk menampilkan string per huruf (efek typing)
void typeText(String text, int row) {
lcd.clear(); // Bersihkan LCD sebelum typing
lcd.setCursor(0, row);
for (int i = 0; i < text.length(); i++) {
lcd.print(text.charAt(i)); // Print satu huruf
delay(typingDelay); // Delay kecil per huruf
}
}
void setup() {
lcd.init(); // Inisialisasi LCD
lcd.backlight(); // Hidupkan lampu latar
lcd.clear();
lcd.noBlink();
lcd.noCursor();
// Tampilkan judul dengan efek typing
typeText(" Heat Waves", 0); // Baris 0
delay(500); // Pause singkat
typeText(" Glass Animals", 1); // Baris 1
delay(3000); // Tampilkan judul 3 detik
lcd.clear();
}
void loop() {
// Bagian 1
typeText("Sometimes all I", 0);
delay(300); // Pause antar baris
typeText("think about is you", 1);
delay(300);
typeText("Late nights in the", 2);
delay(300);
typeText("middle of June", 3);
delay(4000); // Delay panjang untuk "membaca"
// Bagian 2
typeText("Heat waves been", 0);
delay(300);
typeText("fakin' me out", 1);
delay(300);
typeText("Can't make you", 2);
delay(300);
typeText("happier now", 3);
delay(4000);
// Bagian 3
typeText("Usually I put", 0);
delay(300);
typeText("somethin' on TV", 1);
delay(300);
typeText("So we never think", 2);
delay(300);
typeText("about you and me", 3);
delay(4000);
// Bagian 4
typeText("But today I see", 0);
delay(300);
typeText("our reflections", 1);
delay(300);
typeText("Clearly in Hollywood", 2);
delay(300);
typeText("layin' on the screen", 3);
delay(4000);
// Bagian 5
typeText("You just need a", 0);
delay(300);
typeText("better life than this", 1);
delay(300);
typeText("You need somethin'", 2);
delay(300);
typeText("I can never give", 3);
delay(4000);
// Bagian 6
typeText("Fake water all", 0);
delay(300);
typeText("across the road", 1);
delay(300);
typeText("It's gone now the", 2);
delay(300);
typeText("night has come but", 3);
delay(5000); // Delay lebih panjang di akhir
// Loop akan ulang otomatis dari bagian 1
}