This is a graphics display, not a character display, so it has no concept of text "lines". The included font is 5X8, that is, five pixels wide by eight pixels high. If you allow a blank row between lines, and a blank column between characters, then each character takes up 6 by 9 pixels.
So, you can go to the start of a particular text line by multiplying by 9:
Code: Select all
lcd.setCursor(0,0); //start of line 0
lcd.setCursor(0,9); //start of line 1
lcd.setCursor(0,18); //start of line 2
The same logic applies to finding a character poison on a line. The x coordinate will be a multiple of 6.
Of course, you can write a function to do this for you.
Code: Select all
void SetCharPos(int line, int charPos)
{
lcd.setCursor(charPos-1 * 6, line-1 * 9); //subtract 1 so that we can number lines and charPos from 1 instead of from 0
}
After you set the position, you write the text with lcd.print, the same as with Serial.print:
Code: Select all
lcd.print("Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor");
lcd.println(0xAB, HEX);
lcd.print(99.99);
lcd.println('%');