Small Displays (16 x 2 LCD Display)

advertisement
Small Displays
(16 x 2 LCD Display)
The Pieces
The Theory & Code
Liquid Crystal Display
(Craftdata BC1602A)
x1
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.
Potentiometer
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.
(10k Ohm)
x1
File > Sketchbook > Examples > Library-LiquidCrystal > HelloWorld
The Schematic
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.
Potentiometer
gnd
(ground) (-)
Library Summary
(here's a summary of the LCD library for a full reference visit http://oomlout.com/LCDL )
1
1
+5 volts
pin 12
clear() - Clears the display and moves the cursor to upper left corner
pin 11
LCD
pin 5
pin 4
pin 3
(5v)
(gnd)
pin 2
16
Arduino
Vss (gnd)
Vdd (5v)
Vo (contrast)
RS
R/W
Enable
Data 0
Data 1
Data 2
Data 3
Data 4
Data 5
Data 6
Data 7
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
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
.: Summary LCD Datasheet: http://tinyurl.com/met7ol :.
.: Full LCD Datasheet: http://tinyurl.com/lmjxad :.
The Circuit
The Layout Sheet
Potentiometer
(variable resistor)
A B C D E
1
V+
F Gto
H Gnd
I J
to 5v
2
3
gnd
3
4
5
5
6
6
1
4
7
8
9
to pin 12
10
to pin 11
12
11
13
14
15
16
to pin 5
to pin 4
to pin 3
to pin 2
17
18
19
20
B/light
Vss7(gnd)
8 (5v)
Vdd
9
Vo (contrast)
10 RS
11 R/W
12
Enable
13
Data 0
14
Data 1
15
Data 2
16
Data 3
17
Data 4
18
Data 5
19
Data 6
20
Data 7
21 (5v)
21
22 (gnd)
22
16
23
23
24
24
25
25
CIRC-18
26
26
Showing27
Text
27
(LCD Displays)
28
28
29
29
30
30
A B C D E
.: Instructions: print out, cut out, get making :.
.: for more details visit: http://tinyurl.com/ltvo93 :.
1
2
F G H I
J
Download