LCD Begin and Set cursor position of LCD 16×2 using Arduino

Table of Contents

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.

LCD Begin

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:

set lcd 16x2 cursor position
LCD 16×2 Index

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

 

4.2 5 votes
Article Rating
Subscribe
Notify of
guest
1 Comment
Most Voted
Newest Oldest
Inline Feedbacks
View all comments
Debaparna Sengupta
Debaparna Sengupta
2 years ago

Very helpful

1
0
Would love your thoughts, please comment.x
()
x