16*2, 16*1, 20*4 LCD Interfacing
Using Arduino Uno
By Engr.Habib Ur Rehman
16*2 LCD
Components/Equipment Required:
Following Components/Equipment are
required to perform task.
1. Arduino Uno (https://piees.pk/product/arduino-uno-r3/)
2.
16*2
LCD
3. 220Ω Resistor (https://piees.pk/product/220-ohm-1-4-watt-resistor/)
4.
10KΩ
Potentiometer
5.
Breadboard
6.
Jumper
Wires
Circuit Diagram:
Arduino Program:
#include
"LiquidCrystal.h"
// initialize the
library by providing the nuber of pins to it
LiquidCrystal lcd(2,
3, 8, 9, 10, 11);
void setup() {
lcd.begin(16,2);
// set cursor
position to start of first line on the LCD
lcd.setCursor(0,0);
//text to print
lcd.print("16x2
LCD Interfac");
// set cusor position
to start of next line
lcd.setCursor(2,1);
lcd.print("by
Engr.Habib");
}
void loop()
{}
Note:
If text is not visible the
potentiometer is used for visibility of character.
16*1 LCD
Components/Equipment Required:
Following Components/Equipment are
required to perform task.
1.
Arduino
Uno
2.
16*1
LCD
3.
220Ω
Resistor
4.
10KΩ
Potentiometer
5.
Breadboard
6.
Jumper
Wires
Circuit Diagram:
Arduino Program:
#include
<LiquidCrystal.h>
//
initialize the library with the numbers of the interface pins
LiquidCrystal
lcd(2, 3, 8, 9, 10, 11); /// REGISTER SELECT PIN,ENABLE PIN,D4 PIN,D5 PIN, D6
PIN, D7 PIN
void
setup()
{
// set up the LCD's number of columns and
rows:
lcd.begin(16,-1);
}
void
loop()
{
lcd.print(" 16
* 1 LCD ");//print name
}
Note:
If text is not visible the
potentiometer is used for visibility of character.
20*4 LCD
Components/Equipment Required:
Following Components/Equipment are
required to perform task.
1.
Arduino
Uno
2.
20*4
LCD
3.
220Ω
Resistor
4.
10KΩ
Potentiometer
5.
Breadboard
6.
Jumper
Wires
Circuit Diagram:
Arduino Program:
#include
"LiquidCrystal.h"
//
initialize the library by providing the nuber of pins to it
LiquidCrystal
lcd(2, 3, 8, 9, 10, 11);
void
setup() {
lcd.begin(20,4);
//
set cursor position to start of first line on the LCD
lcd.setCursor(0,0);
//text
to print
lcd.print("20x4
LCD Interfacing");
//
set cusor position to start of next line
lcd.setCursor(3,1);
lcd.print("by Engr.Habib");
lcd.setCursor(9,2);
lcd.print("Ur");
lcd.setCursor(7,3);
lcd.print("Rehman");
}
void
loop()
{}
Note:
If text is not visible the
potentiometer is used for visibility of character.
No comments:
Post a Comment