I was having difficulty writing long scrolling text to these displays.
I came up with this function, it specifies the text (any length) and the line to write it on.
Maybe it's not cool but it worked for me.
void printLine(String text, int line){
String lcdLine = (" ");// used to get a blank line
lcd.setCursor(0,line);
//print variable clubName
for (x=0; x < text.length(); x++){
if (x>15){
//sorts out the 16 char limit on display by shuffling everything along
for(x1 = 0; x1 < 15; x1++){
char temp = (lcdLine.charAt((x1) + 1));
lcdLine.setCharAt(x1, temp);
}
lcdLine.setCharAt(15,text.charAt(x));
lcd.setCursor(0,line);
lcd.print(lcdLine);
}else{
//prints if message size less than 16
lcdLine.setCharAt(x,text.charAt(x));
lcd.setCursor(0,line);
lcd.print(lcdLine);
}
delay(100);
}
}