Vous êtes sur la page 1sur 1

&

Small Displays (16 x 2 LCD Display)


The Theory & Code
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
gnd (ground) (-)

The Pieces
Liquid Crystal Display

x1
16 Pin Header

x1
Potentiometer
(10k Ohm)

x1

The Schematic
Potentiometer

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.
+5 volts

LCD

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
(5v) (gnd)

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

The Circuit

21 (5v) 22 (gnd)

B/light

.: Instructions: print out, cut out, get making :. .: for more details visit: http://ardx.org/CIRC-LCD :.

1
pin 12
pin 11

Arduino

pin 5 pin 4

pin 3
pin 2
16

Technical Details .: Full LCD Datasheet: http://ardx.org/LCD-DATAS :.

The Layout Sheet


Potentiometer
(variable resistor)

A B C D E

F Gto H Gnd I J

1 2 3 4 5 6

V+ gnd

to 5v

1 2 3 4 5 6 7 8 9

7 Vss (gnd) 8 Vdd (5v) 9 Vo (contrast) 10RS 11 R/W 12 Enable 13 0 Data 14 1 Data 15 Data 2 16 3 Data 17 4 Data 18 5 Data 19 6 Data 20 Data 7

to pin 12 to pin 11

10 11 12 13 14 15 16

-SPARKFUN16 x 2 LCD

to pin 5 to pin 4 to pin 3 to pin 2

17 18 19 20 21 22 23 24 25

16
A B C D E F G H I J

23 24 25 26 27 28 29 30

CIRC-LCD 26
Showing27 Text
(LCD Displays) 28
29 30

Vous aimerez peut-être aussi