Post by Admin on Jun 1, 2016 17:03:39 GMT
-->>Prologue:
Liquid Crystal Library,as the name suggests is a pre-defined library of codes in the Arduino Software to ease the control input of a standard LCD Screen...
Now,U all are probably wondering,is it the same LCD screen that we use in our Television or our desktop Computers?
The Answer is YES!!
Arduino Gives u a very easy access to the display of your standard LCD screen.
-->>What exactly is an LCD screen?
For understanding this,u need to understand what are Pixels.Pixels are smallest units of your screen,each of them illuminated with micro-leds in various patterns
and combinations to display various Characters.
Hence,our input with some fixed ASCII value is first converted into binary and hence to the pixelated display on your screen.How exactly this happens(mechanism of the internal hardware),will be taught to you in one of the 2nd year course of CS,EEE & ENI branches named Microprocessors&Interfacing.
With Arduino,the benefit is that the pre-defined "Liquid Crystal Library" takes care of everything for u.
Hence,all u are doing is controlling the display with just a bunch of codes.
-->>Making Connections (Reference Diagram)!!
This is what the pins on your LED look like:
Functions of the PINS:
1)A register select (RS) pin that controls where in the LCD's memory you're writing data to. You can select either the data register, which holds what goes on the screen, or an instruction register, which is where the LCD's controller looks for instructions on what to do next.
2)A Read/Write (R/W) pin that selects reading mode or writing mode
3)An Enable pin that enables writing to the registers
4)8 data pins (D0 -D7). The states of these pins (high or low) are the bits that you're writing to a register when you write, or the values you're reading when you read.
5)There's also a display constrast pin (Vo), power supply pins (+5V and Gnd) and LED Backlight (Bklt+ and BKlt-) pins that you can use to power the LCD, control the display contrast, and turn on and off the LED backlight, respectively.
In the Arduino,u'll be using a 4 pin connection mode(dual input from MSB) for convenience:
Circuit Diagram:
(Pin V0 to ground)
-->>Syntax:
#include <LiquidCrystal.h>//Loading the Library
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);//Setting the Pins
void setup()
{
// set up the LCD's number of columns and rows:
lcd.begin(16, 2);
// Print a message to the LCD.
lcd.print("hello, world!");
}
void loop()
{
// set the cursor to column 0, line 1
// (note: line 1 is the second row, since counting begins with 0):
lcd.setCursor(0, 1);
// print the number of seconds since reset:
lcd.print(millis() / 1000);
}
-->>Practice Question:
Using Arduino's Liquid Crystal Library(various functions like lcd.clear(),lcd.print(""),etc available on the official website of Arduino),
[Link:https://www.arduino.cc/en/Reference/LiquidCrystal]
build your own custom character and display it on your screen.[Use lcd.clear() after every step change in character/cursor on the display]??
Liquid Crystal Library,as the name suggests is a pre-defined library of codes in the Arduino Software to ease the control input of a standard LCD Screen...
Now,U all are probably wondering,is it the same LCD screen that we use in our Television or our desktop Computers?
The Answer is YES!!
Arduino Gives u a very easy access to the display of your standard LCD screen.
-->>What exactly is an LCD screen?
For understanding this,u need to understand what are Pixels.Pixels are smallest units of your screen,each of them illuminated with micro-leds in various patterns
and combinations to display various Characters.
Hence,our input with some fixed ASCII value is first converted into binary and hence to the pixelated display on your screen.How exactly this happens(mechanism of the internal hardware),will be taught to you in one of the 2nd year course of CS,EEE & ENI branches named Microprocessors&Interfacing.
With Arduino,the benefit is that the pre-defined "Liquid Crystal Library" takes care of everything for u.
Hence,all u are doing is controlling the display with just a bunch of codes.
-->>Making Connections (Reference Diagram)!!
This is what the pins on your LED look like:
Functions of the PINS:
1)A register select (RS) pin that controls where in the LCD's memory you're writing data to. You can select either the data register, which holds what goes on the screen, or an instruction register, which is where the LCD's controller looks for instructions on what to do next.
2)A Read/Write (R/W) pin that selects reading mode or writing mode
3)An Enable pin that enables writing to the registers
4)8 data pins (D0 -D7). The states of these pins (high or low) are the bits that you're writing to a register when you write, or the values you're reading when you read.
5)There's also a display constrast pin (Vo), power supply pins (+5V and Gnd) and LED Backlight (Bklt+ and BKlt-) pins that you can use to power the LCD, control the display contrast, and turn on and off the LED backlight, respectively.
In the Arduino,u'll be using a 4 pin connection mode(dual input from MSB) for convenience:
Circuit Diagram:
(Pin V0 to ground)
-->>Syntax:
#include <LiquidCrystal.h>//Loading the Library
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);//Setting the Pins
void setup()
{
// set up the LCD's number of columns and rows:
lcd.begin(16, 2);
// Print a message to the LCD.
lcd.print("hello, world!");
}
void loop()
{
// set the cursor to column 0, line 1
// (note: line 1 is the second row, since counting begins with 0):
lcd.setCursor(0, 1);
// print the number of seconds since reset:
lcd.print(millis() / 1000);
}
-->>Practice Question:
Using Arduino's Liquid Crystal Library(various functions like lcd.clear(),lcd.print(""),etc available on the official website of Arduino),
[Link:https://www.arduino.cc/en/Reference/LiquidCrystal]
build your own custom character and display it on your screen.[Use lcd.clear() after every step change in character/cursor on the display]??