Learning Examples | Foundations | Hacking | Links
Examples > Libraries > LiquidCrystal
The LiquidCrystal library allows you to control LCD displays that are compatible with the Hitachi HD44780 driver. There are many of them out there, and you can usually tell them by the 16-pin interface.
This example sketch shows how to use the leftToRight() and rightToLeft() methods. These methods control which way text flows from the cursor.
rightToLeft() causes text to flow to the left from the cursor, as if the display is right-justified.
leftToRight() causes text to flow to the right from the cursor, as if the display is left-justified.
This sketch prints a through l right to left, then m theough r left to right, then s through z right to left again.
NOTE: The LiquidCrystal library has undergone revisions after Arduino version 0016. Thanks to Limor Fried for the rewrite to include 4-bit and 8-bit modes and more functionality. If you are running Arduino 0016 or earlier, please download the current version of the LiquidCrystal library and install it in your hardware/libraries folder.
Users of 0017 and later will not need to install the update.
Note: This wiring diagram is different than the one for previous versions of the LiquidCrystal library. The R/W pin is connected to ground, and the Enable pin is moved over to pin 11, saving you one I/O pin for other uses.
click the image to enlarge
image developed using Fritzing. For more circuit examples, see the Fritzing project page
Schematic:
click the image to enlarge