arduinoLiquid Crystal Library


Introduction

Arduino's Liquid Crystal Library is a library for controlling LCD displays compatible the Hitachi HD44780 driver, characterised by their 16 pin interface. The 16 pins might be connected via an I2C interface. These displays contain a matrix of 5x7 pixel blocks used to display characters or small monochromatic images. The displays are usually named according to how many rows and columns they have, e.g. 16x2 or 1602 for 16 columns and 2 rows, and 20x4 or 2004 for 20 columns and 4 rows.

Syntax

  • #include <LiquidCrystal.h> // Includes the library
  • LiquidCrystal(rs, enable, d4, d5, d6, d7) //
  • LiquidCrystal(rs, rw, enable, d4, d5, d6, d7)
  • LiquidCrystal(rs, enable, d0, d1, d2, d3, d4, d5, d6, d7)
  • LiquidCrystal(rs, rw, enable, d0, d1, d2, d3, d4, d5, d6, d7)

Parameters

LiquidCrystal ParameterDetails
rsthe number of the Arduino pin that is connected to the RS pin on the LCD
rwthe number of the Arduino pin that is connected to the RW pin on the LCD (optional)
enablethe number of the Arduino pin that is connected to the enable pin on the LCD
d0 - d7the numbers of the Arduino pins that are connected to the corresponding data pins on the LCD. d0, d1, d2, and d3 are optional; if omitted, the LCD will be controlled using only the four data lines (d4, d5, d6, d7).