How to use a LCD Part 2
>
>
How to use a LCD Part 2

In the last part of How to use a LCD we learnt how do the pins work , different modes of the LCD & using the Liquid Crystal library to show characters on the LCD. If you haven’t gone through it click here to read that first.

lcd.clear()

As the name suggests, this function does nothing more than just clear the display

lcd.blink()

As the name suggests, it will start blinking the location of the LCD cursor.

lcd.noBlink()

As the name suggests, it will stop the blinking LCD cursor.

lcd.cursor()

As the name suggests, it will display an undersocre (_) under the place where the cursor is going to write on.

lcd.noCursor()

As the name suggests it will hide the cursor

Attached is another sample code to get you kickstarted

#include <LiquidCrystal.h> //Including the library
LiquidCrystal lcd = LiquidCrystal(2,3,4,5,6,7); //Making an object 

void setup(){
    lcd.begin(16,2); // Determining the number of columns & rows
}

void loop(){
    lcd.print("Botuniverse"); // Prints "Botuniverse" on lcd
    delay(3000); // Makes the program wait for 3 seconds
    lcd.cursor(); // Observe where the cursor is
    delay(2000); // Makes the program wait for 2 seconds
    lcd.setCursor(2,1); // Sets the location of the cursor. Observe where the cursor is
    lcd.print("LCD Tutorial") // Prints LCD Tutorial
    delay(3000); // Makes the program wait for 3 seconds
    lcd.clear(); //See the LCD get completely empty
    lcd.blink(); //Observe which box is blinking
    delay(4000); //Makes the program wait for 4000 seconds
    lcd.setCursor(7,1); //Now see which box is blinking
    delay(3000);
    lcd.noBlink(); //Closing the program *ALL the other lines
    lcd.noCursor();
    lcd.clear();
}

I hope the code was self-explanatory & so was the post, in the next part I will be covering custom characters. If you have any suggestions / ideas or doubts you can ask it in the comments section below or mail me at ideas@botuniverse.in .

There are no comments

Leave a Reply

Start typing and press Enter to search

Shopping Cart

No products in the cart.