// Quick and dirty example of scrolling text.
// I did not check if everything is correct.
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27, 20, 4);
char *scroll_text = " This text is scrolling ";
int index = 0;
void setup()
{
lcd.init();
lcd.backlight();
lcd.setCursor(0, 0); // upper
lcd.print("Static Text");
}
void loop()
{
// Select the characters.
// Start with index, exactly 16 characters long.
char buffer[20];
strncpy(buffer, scroll_text + index, 16);
buffer[16] = '\0';
index++;
if(index >= strlen(scroll_text)-16)
index = 0;
lcd.setCursor(0, 1); // lower
lcd.print(buffer);
delay(150);
}