#include <LiquidCrystal_I2C.h> //liquid crystal with I2C library
LiquidCrystal_I2C lcd(0x27, 16, 2); // set the LCD address to 0x27 for a 16 chars and 2 line display
int counter = 0;
void setup()
{
lcd.init(); // initialize the lcd
lcd.backlight(); //Turn on backlight
}
void loop()
{
if (counter == 0 && counter < 16 )
{
for (int positionCounter = 0; positionCounter < 16; positionCounter++)
{
lcd.setCursor(0, 0);
lcd.print("Selamat Datang !!");
lcd.scrollDisplayRight();
// wait a bit:
delay(250);
counter = counter +1;
}
lcd.clear();
}
else if (counter == 16 && counter < 32)
{
for (int positionCounter = 0; positionCounter < 38; positionCounter++)
{
lcd.setCursor(11, 1);
lcd.print("Universitas Amikom Yogyakarta");
lcd.scrollDisplayLeft();
// wait a bit:
delay(250);
counter = counter +1;
}
lcd.clear();
}
else
{
counter = 0;
}
}