Sie sind auf Seite 1von 20

LIQUID CRYSTAL

DISPLAY (LCD)
• Liquid Crystal Display or LCD, is a
simple screen that uses the light
modulating properties of liquid
crystals.
• It can display commands, information
and your sensor readings.
• Numerous devices and gadgets use
LCD screen. Devices such as digital
watches, game consoles, portal
computers, electronic billboards and
smart phones
LCD PIN CONFIGURATION
• LCD uses module for minimal use of Arduino pins, originally it
has 16 pins to configure.
With Module LCD
I2C Character LCD Arduino

GND GND
VCC 5V
SDA A4
SCL A5
LIBRARY
• Libraries are compilation of code that
makes it easy for you to program sketches
with extra functionality.
• To use a Built-in library in a sketch simply
go to the Sketch menu, and choose
“Import Library” and select from the
libraries available
• It will automatically insert an #include
statement at the top of your sketch with
the header(.h) and the library’s name.
Sample Code Using the Library
• lcd.clear(); is used to clear the old data on
LCD screen and position the cursor in the
upper left corner or the default mode
• lcd,setCursor (0,1); used to move the
invisible cusrsor to any location on the LCD
before sending the data. Counting always
starts from zero, so the top line is line 0
and the bottom line is 1. Column runs
from 0 on the left side , to 15 on the right
side. In the program we’ll set the invisible
cursor to the rest column of the second
line (row 2)
• lcd.print(“I LOVE PCS”); used to display a
message on the LCD. Data or message can be
char, byte, int, long, or string.
lcd.print(millis()/1000); is used to print the
number of second (millis()/1000).
• cursor()
Displays the LCD cursor: an underscore (line) at
the position of the next character to be printed.
• noCursor()
Hides the LCD cursor. The following example
creates a blinking cursor at the end of “Hello
World!”.
• blink()
Creates a blinking block style LCD cursor: a
blinking rectangle at the position of the next
character to be printed.
• display()
This function turns on the LCD screen and displays
any text or cursors that have been printed to the
display.
• noDisplay()
This function turns off any text or cursors printed
to the LCD. The text/data is not cleared from the
LCD memory. This means it will be shown again
when the function display() is called.
• scrollDisplayLeft()
Scrolls the contents of the display (text and cursor)
one space to the left. You can use this function in
the loop section of the code in combination
with delay(500), to create a scrolling text
animation.
• scrollDisplayRight()
Scrolls the contents of the display (text and cursor)
one space to the right.
• autoscroll()
This function turns on automatic scrolling of the
LCD. This causes each character output to the
display to push previous characters over by one
space. If the current text direction is left-to-right
(the default), the display scrolls to the left, if the
current direction is right-to-left, the display scrolls
to the right. This has the effect of outputting each
new character to the same location on the LCD.
OTHER USEFUL COMMANDS
• home() is used to position the cursor in its
default position cursor(),blink(), display()
used to control device behavior during
standby. scrollDisplayLeft() and
scrollDisplayRight() used to moves the
display one space to the left/right.
autoscroll() is a function that
automatically scrolls incoming text based
on text dimension leftTorRght and
rightToLeft is used to control text
direction.
LM35 TEMPERATURE SENSOR

Das könnte Ihnen auch gefallen