LCD begin and set cursor position is the important part of LCD, here you will see function use to start LCD and concept of setting cursor position.
Before any function/method we will use begin() function of LCD, using the object we created that is “lcd”. Syntax to initialize the lcd screen: object.begin(column, row);
// (in our case) lcd.begin(16, 2) ;
Set Cursor Position
Now, Setting up cursor position is an important part of LCD which defines at which index (column and row) we want to display text. As we know we are using 16×2 alphanumeric LCD that means 16 columns and 2 rows, index shown in diagram:
Here we are addressing index of column by Ci and index of row by Rj where range of i is 0-15 and of j is 0-1.
/* Setting cursor position to index 0,0, Means Top left of LCD*/ lcd.setCursor(0, 0); // lcd.setCursor(column, row)
/* Setting cursor position to index 0,1, Means Bottom left of LCD*/ lcd.setCursor(0,1); // lcd.setCursor(column, row)
Read Next : DISPLAY TEXT OR STRING ON LCD 16×2 USING ARDUINO