You are on page 1of 6
TWTORALS(/EN/TUTORALHOMEPAGE)» Examples om Uae (en turabrartsaeles)» questa» Bplay display() and noDisplay() methods ‘The Liquid Crystal Library (//wmw arduino.cc/en/Reference/LiquidCrystal) allows you ta control LCD displays that are compatible ‘the Hitachi HD44780 criver. There are many of them aut there, and you can usvallytelthem by the 16-pin interface, This example sketch shows how to use the dsplay() and noDisplay() methods to turn on and off the display. The text tobe displayed ill stil be preserves when you use noDisplay() sa isa quick way to blank the display without losing everything anit Hardware Required = Arduino of Genuine Board = LCD Screen (compatible with Hitachi HD44780 driver) = pin headers to solder to the LCD display pins = 10k ohm potentiow = 20.chm resistor = hook-up wites = breadboard Circuit Before wiring the LCD screen to your Arduina or Genuino board we suggest to solder a pin header strip tothe 14 (or 16) in count connector of the LCD sereen, as you can seein the image above. Towire your LCO screen to your board, connect the following pins = LED RS pinto digital pin 12 = LeD Enable pin to digital pin = LCD D4 pinto cigital pins = LCD DS pin to digital pin 4 = LCD DS pin to aigital pina = Led D7 pin to digital pin 2 ‘Additionally, wire a10« pot to +5V and GND, with i's wiper (output) to LCD screens VO pin (pin). A 220 ohm resistors used to power the backlight of the display, usually on pin 1S and 16 of the LCD connector (fun arduino.cclen/uploads/Tutoral/LCD_Base_bb_Fritzpng) Image developed using Fteng(tp//wnn tsingor Formore ext examples sete eiteng project page (tp: kaing ogres) Schematic “lke images to enlarge (//erwwarduino.cc/en/uploads/Tutorial/LCD_Base_bb_Schem png) age ere oped wang tng tips etapa Fr more cut earls ae the itzng proc page (tip cng oraf cbt) Code - Liquidcrystal Library - display() and nobisplay() Demonstrates the use 2 1612 LOD display. The Liquidcrystal Libsary wozks with ali LCD displays that aze compatible with the iseaeht 048780 driver. There aze many of them out there, and you ‘can usually tell then by the 16-pin interface This sketch prints ‘Hello World!" to the LCD and uses the atsplay() and noDisplay() functions to tuxn on and off the display. the cizcuie + LC RS pin to digital pin 12 LCD Enable pin to digital pin 11 LCD bf pin to digital pin 5 LED BS pin to digital pin 4 LCD D6 pin to digital pin > + Leo 07 pan to dsgital pin 2 + Leb R/W pan t0 gxouna + ok sesistac: + ends to +5V and ground * wiper to (C0 vO pin (pin 3) Libzaxy ozipinally added 18 Aor 2008 by avid A. Melis Library modified 5 Jul 2009 by Linor Fried (http://w. ladyada.net) ‘exanple added $ Jul 200 by Tom 2908 nodified 22 Nov 2010 by Tom T908 modified 7 Nov 2016 by Azture Cuedalupi This example code 1s in the public domain bnesp://w azduino,ce/en/Tutorial/LiquidCzystal0isplay ” UL include the library code: include // Andtialize the Libraxy by assoctating any needed LCD interface pin U/ with the arduine pin number 48 35 connected const int te = 12, en = 11, 48 = 5, a5 = 4, 36 Lequidcrystal ears, en, d¢, 45, 48, 67) 3, 7 = 2 void setup) ( 77 set up the LCD's number of columns and rows: led. begin(16, 2) W/ print a message to the LCD. Led.print(*hello, woria! void 00p() { 1 Tux off the display: detay(s00) W Tuzn on the display Led azspiey() ‘delay(s0o) See Also = Liquid Crystal Library (//www arduino.cc/en/Reference/LiquidCrystal)- Your reference for the Liquid Crystal brary led begin (//wwwarduino cc/en/Reference/LiquidCrystalBeginy) led print (//wwn.arduino cc/en/Reference/tiquidCrystalPring)Q = led Display (//wwwarduino cc/en/Reterence/LiquidCrystalDisplay)) = IedNoDisplay (www arduino ce/en/Reference/LiquidCrystalNoDisplay)() = Hello World! (//wwwarduino.ce/en/Tutorial/HelloWorld) ~ How to wire an LCD display and bring it tole. = Blink (/svww arduine.ce/en/Tutorial/LiquidCeystalBlink) - Control of the block-style cursor. = Cursor (//awwarduino ec/en/Tutoral/LiquidcrystalCursor) - Control ofthe underscore-style cursor = TextDirection //mwrw.arduino.cc/en/TutorialLiquidCrystalTextDirection) - Control which way text flows from the cursor. = Scroll (//mwwarduino cefen/Tutoral/LiquidCrystalScrol) - Scroll text left and Fight. = Serial display (//seww arduino.cc/en/Tutorial/LiquidCrystalSerialDisplay) - Accepts serial input, displays it = SetCursor (//wwwvarduino.cc/en/Tutoril/LiquidCrystalsetCursor - Set the cursor position = Autoseral(//wwuw-arduino.ce/en/Tutoral/LiquiéCrystalAutoscroll)- Shift text right and left Last revision 2015/08/17 by SM Share 00008

You might also like