hitachi hd44780 lcd display free sample

#include#defineLCD_RS7// Register select#defineLCD_E6// Enable#defineLCD_D45#defineLCD_D54#defineLCD_D63#defineLCD_D72// * LCD R/W pin to ground

// initialize the library with the numbers of the interface pinsLiquidCrystallcd(LCD_RS,LCD_E,LCD_D4,LCD_D5,LCD_D6,LCD_D7);voidsetup(){lcd.begin(16,2);// set up the LCD"s columns and rowslcd.print("How to Drive an");lcd.setCursor(0,1);lcd.print("HD44780 16x2 LCD");

The following fuctions are self-evident, taking no arguments:voidclear();voidhome();voidnoDisplay();voiddisplay();voidnoBlink();voidblink();voidnoCursor();voidcursor();voidscrollDisplayLeft();voidscrollDisplayRight();voidleftToRight();voidrightToLeft();voidautoscroll();voidnoAutoscroll();

#include#defineLCD_RS7// Register select#defineLCD_E6// Enable#defineLCD_D45#defineLCD_D54#defineLCD_D63#defineLCD_D72// * LCD R/W pin to ground

// initialize the library with the numbers of the interface pinsLiquidCrystallcd(LCD_RS,LCD_E,LCD_D4,LCD_D5,LCD_D6,LCD_D7);voidsetup(){lcd.begin(16,2);// set up the LCD"s columns and rowslcd.clear();lcd.print("Time:");lcd.setCursor(0,1);lcd.print("Time from reset.");}longcountTime=0;longoldTime=0;voidloop(){delay(1);countTime+=1;if(millis()-oldTime>99){// update every 99mslcd.setCursor(5,0);lcd.print(countTime,DEC);oldTime=millis();}

#include#defineLCD_RS7// Register select#defineLCD_E6// Enable#defineLCD_D45#defineLCD_D54#defineLCD_D63#defineLCD_D72bytecc[8];// Custom Character// * LCD R/W pin to ground

// initialize the library with the numbers of the interface pinsLiquidCrystallcd(LCD_RS,LCD_E,LCD_D4,LCD_D5,LCD_D6,LCD_D7);// 0 is the full block character

// 4 has 4 left bars filled.voidcreateBarChars(void){bytemask=0x10;bytecurrent=0;for(intcgchar=1;cgchar<=4;cgchar++){current|=mask;mask=mask>>1;for(inti=0;i<8;i++)cc[i]=current;lcd.createChar(cgchar,cc);}for(inti=0;i<8;i++)cc[i]=0x1f;// Create full block.lcd.createChar(0,cc);

}voiddrawBar(bytex,bytey,bytepixels){inti;byteblocks=pixels/5;// 5 pixels wide per character.byterem=pixels%5;for(i=0;i

}longcountTime=0;longoldTime=0;voidloop(){staticintidxcg=0;delay(1);countTime+=1;if(millis()-oldTime>99){// update every 99mslcd.setCursor(5,0);lcd.print(countTime,DEC);oldTime=millis();if((countTime/250)%80==0){// Clear Bar Area.lcd.setCursor(0,1);lcd.print(" ");}drawBar(0,1,(countTime/250)%80);// parameter update is quarter seconds.}

hitachi hd44780 lcd display free sample

This library written in Go programming language to control parameters of and output alpha-numeric characters to liquid-crystal display equiped with HD44780 integrated circuit (pdf reference). This code intended to run from Raspberry PI to get control above liquid-crystal display via i2c bus controller (soldered to lcd-display on the back side).

There is some variety in display size, so library was tested with two kinds (width x height): 16x2 and 20x4 (pictures 1 and 2 correspond to 16x2 display, picture 3 - 20x4 display):

NOTE 2: If you experience issue with lcd-device stability play with strobe delays in routine writeDataWithStrobe(data byte). Default settings: 200 ms (microseconds) for setting stober, and 30 ms for exposing it to zero. Try to increase them a little bit, if you expirience any malfunction.

hitachi hd44780 lcd display free sample

A Swift library for 16x2(aka 1602A), 20x4(aka 2004A) or bigger Character LCDs with an Hitachi HD44780 controller or one of its clones(KS0066, SPLC780D, ST7066U, NT8331D, etc...).

A Swift library for 16x2(aka 1602A), 20x4(aka 2004A) or bigger Character LCDs with an Hitachi HD44780 controller or one of its clones(KS0066, SPLC780D, ST7066U, NT8331D, etc... 99% of the controllers on the market).

wget https://raw.githubusercontent.com/uraimo/HD44780CharacterLCD.swift/master/Sources/HD44780CharacterLCD.swift https://raw.githubusercontent.com/uraimo/SwiftyGPIO/master/Sources/SwiftyGPIO.swift https://raw.githubusercontent.com/uraimo/SwiftyGPIO/master/Sources/Presets.swift https://raw.githubusercontent.com/uraimo/SwiftyGPIO/master/Sources/SunXi.swift

The A and K pins are used for the backlight, if you have and RGB backlight LCD, you"ll have three pins instead of two. Usually you will just connect K to GND and A to VDD(5V). The V0 pins regulates the display contrast, you could connect it to GND for maximum contrast or you could search the value you prefer with a 20K variable resistor, here i suggest you to use a 470 Ohm resistor connected to GND that will give you a good value of contrast (see pitcure above), if you don"t like it feel free to experiment.

The library needs 6 GPIO Objects created with SwiftyGPIO to initialize the HD44780 class, let"s see how to do it on a RaspberryPi 2, we"ll use the first 6 gpios on the left side of the header:

The cursor, a functionality provided by the HD44780 LCD, points to the position where the next character should be drawn, the cursor can be moved to home (0,0) or to a specific position:

hitachi hd44780 lcd display free sample

The Hitachi HD44780 LCD controller is an alphanumeric dot matrix liquid crystal display (LCD) controller developed by Hitachi in the 1980s. The character set of the controller includes ASCII characters, Japanese Kana characters, and some symbols in two 40 character lines. Using an extension driver, the device can display up to 80 characters.

The Hitachi HD44780 LCD controller is limited to monochrome text displays and is often used in copiers, fax machines, laser printers, industrial test equipment, and networking equipment, such as routers and storage devices.

Compatible LCD screens are manufactured in several standard configurations. Common sizes are one row of eight characters (8×1), and 16×2, 20×2 and 20×4 formats. Larger custom sizes are made with 32, 40 and 80 characters and with 1, 2, 4 or 8 lines. The most commonly manufactured larger configuration is 40×4 characters, which requires two individually addressable HD44780 controllers with expansion chips as a single HD44780 chip can only address up to 80 characters.

Character LCDs may have a backlight, which may be LED, fluorescent, or electroluminescent. The nominal operating voltage for LED backlights is 5V at full brightness, with dimming at lower voltages dependent on the details such as LED color. Non-LED backlights often require higher voltages.

Character LCDs use a 16-contact interface, commonly using pins or card edge connections on 0.1 inch (2.54 mm) centers. Those without backlights may have only 14 pins, omitting the two pins powering the light. This interface was designed to be easily hooked up to the Intel MCS-51 XRAM interface, using only two address pins, which allowed displaying text on LCD using simple MOVX commands, offering cost effective option for adding text display to devices.

Vee (also V0): This is an analog input, typically connected to a potentiometer. The user must be able to control this voltage independent of all other adjustments, in order to optimise visibility of the display that varies i. a. with temperature and, in some cases, height above the sea level. With a wrong adjustment, the display will seem to malfunction.

R/W: In most applications, reading from the HD44780 is not necessary. In that case, this pin can be permanently connected to ground and no processor pins need to be allocated to control it.

Selecting 4-bit or 8-bit mode requires careful selection of commands. There are two primary considerations. First, with D3–D0 unconnected, these lines will always appear high (binary 1111) to the HD44780 since there are internal pull-up MOSFETs.

The execution times listed in this table are based on an oscillator frequency of 270 kHz. The data sheet indicates that for a resistor of 91 kΩ at VCC=5 V the oscillator can vary between 190 kHz and 350 kHz resulting in wait times of 52.6 µs and 28.6 µs instead of 37 µs. If a display with the recommended 91 kΩ resistor is powered from 3.3 volts the oscillator will run much slower. If the busy bit is not used and instructions are timed by the external circuitry, this should be taken into account.

The original HD44780 character generator ROM contains 208 characters in a 5×8 dot matrix, and 32 characters in a 5×10 dot matrix. More recent compatible chips are available with higher resolution, matched to displays with more pixels.

hitachi hd44780 lcd display free sample

The Hitachi HD44780 LCD controller is an alphanumeric dot matrix liquid crystal display (LCD) controller developed by Hitachi in the 1980s. The character set of the controller includes ASCII characters, Japanese Kana characters, and some symbols in two 40 character lines. Using an extension driver, the device can display up to 80 characters.

The Hitachi HD44780 LCD controller is limited to monochrome text displays and is often used in copiers, fax machines, laser printers, industrial test equipment, and networking equipment, such as routers and storage devices.

Compatible LCD screens are manufactured in several standard configurations. Common sizes are one row of eight characters (8×1), and 16×2, 20×2 and 20×4 formats. Larger custom sizes are made with 32, 40 and 80 characters and with 1, 2, 4 or 8 lines. The most commonly manufactured larger configuration is 40×4 characters, which requires two individually addressable HD44780 controllers with expansion chips as a single HD44780 chip can only address up to 80 characters.

Character LCDs may have a backlight, which may be LED, fluorescent, or electroluminescent. The nominal operating voltage for LED backlights is 5V at full brightness, with dimming at lower voltages dependent on the details such as LED color. Non-LED backlights often require higher voltages.

Character LCDs use a 16-contact interface, commonly using pins or card edge connections on 0.1 inch (2.54 mm) centers. Those without backlights may have only 14 pins, omitting the two pins powering the light. This interface was designed to be easily hooked up to the Intel MCS-51 XRAM interface, using only two address pins, which allowed displaying text on LCD using simple MOVX commands, offering cost effective option for adding text display to devices.

Vee (also V0): This is an analog input, typically connected to a potentiometer. The user must be able to control this voltage independent of all other adjustments, in order to optimise visibility of the display that varies i. a. with temperature and, in some cases, height above the sea level. With a wrong adjustment, the display will seem to malfunction.

R/W: In most applications, reading from the HD44780 is not necessary. In that case, this pin can be permanently connected to ground and no processor pins need to be allocated to control it.

Selecting 4-bit or 8-bit mode requires careful selection of commands. There are two primary considerations. First, with D3–D0 unconnected, these lines will always appear high (binary 1111) to the HD44780 since there are internal pull-up MOSFETs.

The execution times listed in this table are based on an oscillator frequency of 270 kHz. The data sheet indicates that for a resistor of 91 kΩ at VCC=5 V the oscillator can vary between 190 kHz and 350 kHz resulting in wait times of 52.6 µs and 28.6 µs instead of 37 µs. If a display with the recommended 91 kΩ resistor is powered from 3.3 volts the oscillator will run much slower. If the busy bit is not used and instructions are timed by the external circuitry, this should be taken into account.

The original HD44780 character generator ROM contains 208 characters in a 5×8 dot matrix, and 32 characters in a 5×10 dot matrix. More recent compatible chips are available with higher resolution, matched to displays with more pixels.

hitachi hd44780 lcd display free sample

Liquid Crystal Display(LCDs) provide a cost effective way to put a text output unit for a microcontroller. As we have seen in the previous tutorial, LEDs or 7 Segments do no have the flexibility to display informative messages.

This display has 2 lines and can display 16 characters on each line. Nonetheless, when it is interfaced with the micrcontroller, we can scroll the messages with software to display information which is more than 16 characters in length.

The LCD is a simple device to use but the internal details are complex. Most of the 16x2 LCDs use a Hitachi HD44780 or a compatible controller. Yes, a micrcontroller is present inside a Liquid crystal display as shown in figure 2.

It takes a ASCII value as input and generate a patter for the dot matrix. E.g., to display letter "A", it takes its value 0X42(hex) or 66(dec) decodes it into a dot matrix of 5x7 as shown in figure 1.

Power & contrast:Apart from that the LCD should be powered with 5V between PIN 2(VCC) and PIN 1(gnd). PIN 3 is the contrast pin and is output of center terminal of potentiometer(voltage divider) which varies voltage between 0 to 5v to vary the contrast.

hitachi hd44780 lcd display free sample

LCD means liquid crystal display. Basically, any displays can be used with Arduino, including alphanumeric character LCD display, monochrome graphic LCD display, color TFT LCD display, IPS LCD display. It can also be used for non LCD displays like: PMOLED display, AMOLED display, E-ink (E-paper) displays.  Orient Display developed easy interface (SPI, I2C) displays which can be easily used with Arduino.

LCD displays were first used for watches and calculators.  Now, LCD display technology dominants the display world, it can be found in wearables, smart homes, mobile phones, TVs, laptops, monitors, kiosks, aircraft cockpit, digital cameras, lab instrument, power grid etc.

LCD itself can emit light itself. It has to utilize outside light sources. LCD display module normally includes LCD glass (or LCD panel), LCD driving circuitry ( can be COG, COB or TAB) and a backlight.

A LCD display 16*2 is actually a basic and simple to use LCD module. It includes LCD glass, COB (Chip on PCB Board) LCD control board, backlight, zebra to connect LCD glass and control board and a bezel to hold everything together.  16×2 LCD display can display 16 characters per line and there are two lines. Each character has 5×7 dot matrix pixels and the cursor underneath. All 16×2 LCD display originally used standard Hitachi HD44780 driver. Of course the legendary HD44780 controller had EOL long time ago. All the 16×2 LCD displays use HD44780 compatible LCD controllers. Some of them are drop replacement, some of them need to modify the initialization code a little.

Pin5 (Read/Write/Control Pin): This pin toggles the display among the read or writes operation, and it is connected to a microcontroller unit pin to get either 0 or 1 (0 = Write Operation, and 1 = Read Operation).

Pins 7-14 (Data Pins): These pins are used to send data to the display. These pins are connected in two-wire modes like 4-bit mode and 8-bit mode. In 4-wire mode, only four pins are connected to the microcontroller unit like 0 to 3, whereas in 8-wire mode, 8-pins are connected to microcontroller unit like 0 to 7.

A 16×2 LCD has two registers like data register and command register. The RS (register select) is mainly used to change from one register to another. When the register set is ‘0’, then it is known as command register. Similarly, when the register set is ‘1’, then it is known as data register.

Command Register: The main function of the command register is to store the instructions of command which are given to the display. So that predefined tasks can be performed such as clearing the display, initializing, set the cursor place, and display control. Here commands processing can occur within the register.

Data Register: The main function of the data register is to store the information which is to be exhibited on the LCD screen. Here, the ASCII value of the character is the information which is to be exhibited on the screen of LCD. Whenever we send the information to LCD, it transmits to the data register, and then the process will be starting there. When register set =1, then the data register will be selected.

There are 19 different functions in the LiquidCrystal library available for us to use. These functions do things like change the position of the text, move text across the screen, or make the display turn on or off. What follows is a short description of each function, and how to use it in a program.

The LiquidCrystal() function sets the pins the Arduino uses to connect to the LCD. You can use any of the Arduino’s digital pins to control the LCD. Just put the Arduino pin numbers inside the parentheses in this order:

This function sets the dimensions of the LCD. It needs to be placed before any other LiquidCrystal function in the void setup() section of the program. The number of rows and number of columns are specified as lcd.begin(columns, rows). For a 16×2 LCD, you would use lcd.begin(16, 2), and for a 20×4 LCD you would use lcd.begin(20, 4).

This function clears any text or data already displayed on the LCD. If you use lcd.clear() with lcd.print() and the delay() function in the void loop() section, you can make a simple blinking text program.

Similar, but more useful than lcd.home() is lcd.setCursor(). This function places the cursor (and any printed text) at any position on the screen. It can be used in the void setup() or void loop() section of your program.

The cursor position is defined with lcd.setCursor(column, row). The column and row coordinates start from zero (0-15 and 0-1 respectively). For example, using lcd.setCursor(2, 1) in the void setup() section of the “hello, world!” program above prints “hello, world!” to the lower line and shifts it to the right two spaces:

This function creates a block style cursor that blinks on and off at approximately 500 milliseconds per cycle. Use it in the void loop() section. The function lcd.noBlink() disables the blinking block cursor.

This function turns on any text or cursors that have been printed to the LCD screen. The function lcd.noDisplay() turns off any text or cursors printed to the LCD, without clearing it from the LCD’s memory.

This function takes anything printed to the LCD and moves it to the left. It should be used in the void loop() section with a delay command following it. The function will move the text 40 spaces to the left before it loops back to the first character. This code moves the “hello, world!” text to the left, at a rate of one second per character.

lcd.noAutoscroll() turns the lcd.autoscroll() function off. Use this function before or after lcd.autoscroll() in the void loop() section to create sequences of scrolling text or animations.

This function sets the direction that text is printed to the screen. The default mode is from left to right using the command lcd.leftToRight(), but you may find some cases where it’s useful to output text in the reverse direction.

This command allows you to create your own custom characters. Each character of a 16×2 LCD has a 5 pixel width and an 8 pixel height. Up to 8 different custom characters can be defined in a single program. To design your own characters, you’ll need to make a binary matrix of your custom character from an LCD character generator or map it yourself. This code creates a degree symbol (°).

The detailed LCD tutorial can be found in the article. ARDUINO LCD SET UP AND PROGRAMMING GUIDE or to check https://github.com/arduino-libraries/LiquidCrystal

hitachi hd44780 lcd display free sample

Do you want your Arduino projects to display status messages or sensor readings? Then these LCD displays can be a perfect fit. They are extremely common and fast way to add a readable interface to your project.

This tutorial will help you get up and running with not only 16×2 Character LCD, but any Character LCD (16×4, 16×1, 20×4 etc.) that is based on Hitachi’s LCD Controller Chip – HD44780.

When current is applied to these crystals, they become opaque, blocking the backlight that resides behind the screen. As a result that particular area will be dark compared to the others. And this is how the characters are displayed on the screen.

True to their name, these LCDs are ideal for displaying only text/characters. A 16×2 character LCD, for example, has an LED backlight and can display 32 ASCII characters in two rows of 16 characters each.

If you look closely you can see tiny rectangles for each character on the display and the pixels that make up a character. Each of these rectangles is a grid of 5×8 pixels.

The good news is that all of these displays are ‘swappable’, which means if you build your project with one you can just unplug it and use another size/color LCD of your choice. Your code will have to change a bit but at least the wiring remains the same!

Vo (LCD Contrast) controls the contrast and brightness of the LCD. Using a simple voltage divider with a potentiometer, we can make fine adjustments to the contrast.

RS (Register Select) pin is set to LOW when sending commands to the LCD (such as setting the cursor to a specific location, clearing the display, etc.) and HIGH when sending data to the LCD. Basically this pin is used to separate the command from the data.

R/W (Read/Write) pin allows you to read data from the LCD or write data to the LCD. Since we are only using this LCD as an output device, we are going to set this pin LOW. This forces it into WRITE mode.

E (Enable) pin is used to enable the display. When this pin is set to LOW, the LCD does not care what is happening on the R/W, RS, and data bus lines. When this pin is set to HIGH, the LCD processes the incoming data.

D0-D7 (Data Bus) pins carry the 8 bit data we send to the display. For example, if we want to see an uppercase ‘A’ character on the display, we set these pins to 0100 0001 (as per the ASCII table).

Now we will power the LCD. The LCD has two separate power connections; One for the LCD (pin 1 and pin 2) and the other for the LCD backlight (pin 15 and pin 16). Connect pins 1 and 16 of the LCD to GND and 2 and 15 to 5V.

Most LCDs have a built-in series resistor for the LED backlight. You’ll find this near pin 15 on the back of the LCD. If your LCD does not include such a resistor or you are not sure if your LCD has one, you will need to add one between 5V and pin 15. It is safe to use a 220 ohm resistor, although a value this high may make the backlight a bit dim. For better results you can check the datasheet for maximum backlight current and select a suitable resistor value.

Next we will make the connection for pin 3 on the LCD which controls the contrast and brightness of the display. To adjust the contrast we will connect a 10K potentiometer between 5V and GND and connect the potentiometer’s center pin (wiper) to pin 3 on the LCD.

That’s it. Now turn on the Arduino. You will see the backlight lit up. Now as you turn the knob on the potentiometer, you will start to see the first row of rectangles. If that happens, Congratulations! Your LCD is working fine.

Let’s finish connecting the LCD to the Arduino. We have already made the connections to power the LCD, now all we have to do is make the necessary connections for communication.

We know that there are 8 data pins that carry data to the display. However, HD44780 based LCDs are designed in such a way that we can communicate with the LCD using only 4 data pins (4-bit mode) instead of 8 (8-bit mode). This saves us 4 pins!

The sketch begins by including the LiquidCrystal library. The Arduino community has a library called LiquidCrystal which makes programming of LCD modules less difficult. You can find more information about the library on Arduino’s official website.

First we create a LiquidCrystal object. This object uses 6 parameters and specifies which Arduino pins are connected to the LCD’s RS, EN, and four data pins.

In the ‘setup’ we call two functions. The first function is begin(). It is used to specify the dimensions (number of columns and rows) of the display. If you are using a 16×2 character LCD, pass the 16 and 2; If you’re using a 20×4 LCD, pass 20 and 4. You got the point!

After that we set the cursor position to the second row by calling the function setCursor(). The cursor position specifies the location where you want the new text to be displayed on the LCD. The upper left corner is assumed to be col=0, row=0.

There are some useful functions you can use with LiquidCrystal objects. Some of them are listed below:lcd.home() function is used to position the cursor in the upper-left of the LCD without clearing the display.

lcd.scrollDisplayRight() function scrolls the contents of the display one space to the right. If you want the text to scroll continuously, you have to use this function inside a for loop.

lcd.scrollDisplayLeft() function scrolls the contents of the display one space to the left. Similar to above function, use this inside a for loop for continuous scrolling.

If you find the characters on the display dull and boring, you can create your own custom characters (glyphs) and symbols for your LCD. They are extremely useful when you want to display a character that is not part of the standard ASCII character set.

CGROM is used to store all permanent fonts that are displayed using their ASCII codes. For example, if we send 0x41 to the LCD, the letter ‘A’ will be printed on the display.

CGRAM is another memory used to store user defined characters. This RAM is limited to 64 bytes. For a 5×8 pixel based LCD, only 8 user-defined characters can be stored in CGRAM. And for 5×10 pixel based LCD only 4 user-defined characters can be stored.

hitachi hd44780 lcd display free sample

This task shows how to interface an Arduino Nano to a 2x16 LCD display driven by the popular Hitachi HD44780 controller. A wide range of LCD displays use this controller, and the Arduino libraries used in this task work with all of them.

Here we will use a 4-bit parallel interface to send commands to the LCD board. You can also find boards with additional circuitry to allow control over popular serial bus protocols such as SPI and I2C.

There are a large number of tutorials discussing a LCD display interfacing to the Arduino. One of the better ones I have found, and was a source of motivation for this task, is this tutorial.

This task has the most complicated wiring of any project we have tackled. The LCD display has 16 pins as shown below. There are 5 pins dedicated to power, 3 control lines, and 8 data lines.

We will briefly describe the functionality of each pin, but you should look at the tutorial linked above for a more complete discussion. Starting from Pin 1, we have Vss (ground) and Vdd (+5V). These provide the power for the digital logic. The next pin, V0, sets the display contrast. You can probably get away with connecting this to +5V, but we will use a potentiometer to ensure we can see the characters. The next three pins are control lines. All but read/write will be connected to the Arduino so that we can manipulate these as needed.

The next 8 pins are data lines used to write 8-bit characters to the display. We will use a 4-bit mode where each byte is sent in 2 separate chunks (nibbles) at a time. This saves 4 wire connections. The final two pins are the Anode (A) and Cathode (K) of the electroluminescent backlight. The anode should be attached to +5V and the cathode to ground.

To get the Nano and LCD board to fit, you must use the orientation shown below. The first two pins of the LCD board (GND and +5V) overlap with the pins in the corner of the Arduino which happen to provide these power connections. This is fortunate, as otherwise the Nano and the LCD board don"t fit on our half-height breadboards. Make sure you have these pins aligned correctly. You should have one free row left on your breadboard if everything is in the right place. The remaining wiring is shown in the figure. In particular, a potentiometer is used to provide a variable voltage to V0, register select (RS) and enable (E) are connected to pins D2 and D3, while the 4 data lines on the LCD D4-D7 are connected to the same numbered pins on the Arduino. The other 4 data lines on the LCD board (D0-D3) are not used. In the drawing

Put the following sketch into the Arduino IDE or else download it from task4.ino. Here we are using one of the many Arduino Libraries to provide easy-to-use functions for interacting with the LCD controller. These libraries are one of the best parts of the Arduino ecosystem. We will be satisfied with just being able to write some simple text to the display.

All of the complexity of initializing the Hitachi controller and sending characters (4 bits at a time) to the data lines is hidden behind the interface of the LiquidCrystal external library. Since this isn"t a built-in command (like Serial) we have to let the compiler know what functions this package provides. That is the role of the header include line #include .

Arduino Digital I/O pins. You can wire these in any order you wish, but these numbers need to match the wiring. The initialization in setup() simply gives the dimensions of the specific display we are using (these LCD displays come in a wide variety of sizes).

The event loop demonstrates a few simple and less simple features of the LiquidCrystal library. After lcd.clear(), the screen is cleared and the cursor is set to the home position in the upper left. As you write, the cursor moves one space to the right so that the characters fill each subsequent space. You can set the cursor to an arbitrary position with lcd.setCursor. With lcd.autoscroll, instead of the cursor moving, the cursor

compile and upload your sketch. You should see the text start showing up on your LCD. If you don"t, you probably need to adjust the contrast. Turn your potentiometer all the way up (clockwise, if you wired it as I showed above) and if all you see is a 2x16 array of blocks, turn it down slightly until the blocks just disappear. The characters should start showing up. If they don"t, check your wiring carefully. I tested every LCD Display before I sent them out, so I am fairly certain they should all be working.

There are a huge number of uses for an LCD display. Look through the documentation at LiquidCrystal and play around with some of the other functions. If you want an interesting challenge, you can look at the createChar function that allows you to create (a few of) your own custom characters.