#include <LiquidCrystal_I2C.h>
//const int rs=12, en=11, d4=5, d5=4, d6=3, d7=2;
LiquidCrystal_I2C lcd(0x27, 16, 2);
void setup() {
lcd.init();
lcd.setCursor(1,0); // Cursor position is fixed for static words.
lcd.print("First Line");
}
void loop() {
// put your main code here, to run repeatedly:
for(int i=15;i>=-13;i--) // loop to move the word in the second line which will start from the last index of the LCD till the space at the end of the word which will be in negative,so that
// the whole word get disappear from the screen (16 positions on the display i.e. 0 to 15 and number of letters of the text entered + space at the end of the text)
{
lcd.setCursor(i,1); // cursor position will be according to 'i'
lcd.print("Second Line1 ");
delay(100);
}
for(int j=15;j>=-13;j--) // Same for this loop
{
lcd.setCursor(j,1); // same for this cursor's position
lcd.print("Second Line2 ");
delay(100);
}
}