Small Displays (16 x 2 LCD Display) · across many displays (HD 44780) which means many...
Transcript of Small Displays (16 x 2 LCD Display) · across many displays (HD 44780) which means many...
-
Small Displays(16 x 2 LCD Display)
Liquid Crystal Display
x1
The Pieces The Theory & Code
The Circuit
.: Instructions: print out, cut out, get making :..: for more details visit: http://ardx.org/CIRC-LCD :.
The Layout Sheet
Liquid Crystal Displays (LCD)
An LCD is a small low cost display. It is easy to interface with a micro-controller because of an
embedded controller (the black blob on the back of the board). This controller is standard
across many displays (HD 44780) which means many micro-controllers (including the Arduino)
have libraries that make displaying messages as easy as a single line of code.
Assembling
To get started you'll need to attach the header pins to your LCD module, learn how to do this
at: http://sparkfun.com/lcd
Testing
Testing your LCD with an Arduino is really simple. Wire up your display using the schematic or
breadboard layout sheet. Then open the Arduino IDE and open the example program.
File > Examples > LiquidCrystal > HelloWorld
Upload to your board and watch as "hello, world!" is shown on your display. If no message is
displayed the contrast may need to be adjusted. To do this turn the potentiometer.
Library Summary
(here's a summary of the LCD library for a full reference visit http://ardx.org/LCD-REF )LiquidCrystal(rs, rw, enable, d4, d5, d6, d7) - create a new LiquidCrystal object using a 4
bit data bus
LiquidCrystal(rs, rw, enable, d0, d1, d2, d3, d4, d5, d6, d7) - create a new
LiquidCrystal object using an 8 bit data bus
clear() - Clears the display and moves the cursor to upper left corner
home() - Moves the cursor to the upper left corner
setCursor(col, row) - moves the cursor to column col and row row
write(data) - writes the char data to the display
print(data) - prints a string to the display
Technical Details
.: Full LCD Datasheet: http://ardx.org/LCD-DATAS :.
The Schematic
pin 5
gnd(ground) (-)
+5 volts
pin 4
pin 3
pin 2
pin 11
pin 12
Potentiometer
Ard
uin
o
1
Vss (gnd)Vdd (5v)
Vo (contrast)RS
R/WEnableData 0Data 1Data 2Data 3Data 4Data 5Data 6Data 7
(5v)
(gnd)
LCD
Potentiometer(10k Ohm)
x1
1
16
&
123456789101112131415161718192021222324252627282930
123456789101112131415161718192021222324252627282930
A B C D E F G H I J
A B C D E F G H I J
CIRC-LCDShowing Text(LCD Displays)
to 5v
to Gnd
to pin 12
Potentiometer(variable resistor)
V+
gnd
to pin 11
to pin 5to pin 4to pin 3to pin 2
B/li
gh
t
16 Pin Header
x1
116
Vss (gnd)Vdd (5v)
Vo (contrast)RS
R/WEnableData 0Data 1Data 2Data 3Data 4Data 5Data 6Data 7
(5v)
(gnd)
-SPARKFUN-
16 x 2 LCD
Page 1