I did a project with a 4X40 display. I set up 4 arrays to act as line buffers so I could also do minor edits and then rewrite the whole line.
I was accepting data from a keyboard so I would copy the lower lines to the upper lines in the array, fill the lower line array with spaces and then write the lines to the display.
All I used was the SetCursor() function prior to writing each line to the display.
The only time I had any problem was if I wrote past the end of the bottom line the cursor would wind up at the top left, which was not a desired action.
Remember - the first line is line 0, and the second line is line 1
Thanks for the tip, did it and it worked.
For those who might need it in future, here is the code
// include the library code: #include <LiquidCrystal.h>
// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
void setup() {
// set up the LCD’s number of columns and rows:
lcd.begin(16, 2);
lcd.setCursor(0,0);
// Print a message to the LCD.
lcd.print(“First line”);
lcd.setCursor(0,1);
lcd.print(“Second line”);
}
void loop() {
// Turn off the blinking cursor:
lcd.noBlink();
delay(3000);
// Turn on the blinking cursor:
lcd.blink();
delay(3000);
}