#include <LiquidCrystal_I2C.h>
int kolom = 16;
int baris = 2;
LiquidCrystal_I2C lcd(0x27, 20, 4);
String TeksDiam = "Hello Guys";
String TeksBergerak = "Selamat Datang Di Kelas XI MIPA 3";
void TulisanBergerak(int row, String message, int delayTime, int kolom) {
for (int i=0; i < kolom; i++) {
message = " " + message;
}
message = message + " ";
for (int pos = 0; pos < message.length(); pos++) {
lcd.setCursor(0, row);
lcd.print(message.substring(pos, pos + kolom));
delay(delayTime);
}
}
void setup(){
lcd.init();
lcd.backlight();
}
void loop(){
lcd.setCursor(3, 0);
lcd.print(TeksDiam);
TulisanBergerak(1, TeksBergerak, 500, kolom);
}