Tutorial.LCDLibrary History

Hide minor edits - Show changes to output

November 22, 2008, at 06:33 PM by David A. Mellis -
Added lines 1-2:
(:redirect Reference/LiquidCrystal :)
September 05, 2006, at 07:54 PM by Heather Dewey-Hagborg -
Changed lines 155-157 from:
To interface an LCD directly in Arduino code see [[http://www.arduino.cc/en/Tutorial/LCD8Bits | this example]].
to:
To interface an LCD directly in Arduino code see [[http://www.arduino.cc/en/Tutorial/LCD8Bits | this example]].

''LCD interface library and tutorial by Heather Dewey-Hagborg''
August 23, 2006, at 09:07 PM by Heather Dewey-Hagborg -
August 09, 2006, at 06:03 PM by Heather Dewey-Hagborg -
Changed line 17 from:
Download the LiquidCrystal library [[ Attach:LiquidCrystal.1.zip| here]].
to:
Download the LiquidCrystal library [[ Attach:LiquidCrystal.zip| here]].
Changed lines 66-67 from:
LiquidCrystal lcd = LiquidCrystal(); //create and initialize a LiquidCrystal object to control an LCD
to:
LiquidCrystal lcd = LiquidCrystal(); //create a LiquidCrystal object to control an LCD
Changed lines 69-70 from:
digitalWrite(13,HIGH); //turn on an LED for debugging
to:
lcd.init(); //initialize the LCD
digitalWrite(13,HIGH); //turn on an LED for debugging
Changed line 74 from:
delay(1000); //repeat forever
to:
delay(1000); //repeat forever
Changed lines 88-89 from:
LiquidCrystal lcd = LiquidCrystal(); //create and initialize a LiquidCrystal object to control an LCD
to:
LiquidCrystal lcd = LiquidCrystal(); //create a LiquidCrystal object to control an LCD
Changed lines 91-92 from:
digitalWrite(13,HIGH); //turn on an LED for debugging
to:
lcd.init(); //initialize the LCD
digitalWrite(13,HIGH); //turn on an LED for debugging
Changed line 116 from:
LiquidCrystal lcd = LiquidCrystal(); //create and initialize a LiquidCrystal object to control an LCD
to:
LiquidCrystal lcd = LiquidCrystal(); //create a LiquidCrystal object to control an LCD
Changed lines 120-121 from:
digitalWrite(13,HIGH); //turn on an LED for debugging
to:
lcd.init(); //initialize the LCD
digitalWrite(13,HIGH); //turn on an LED for debugging
Added line 130:
Changed line 138 from:
LiquidCrystal lcd = LiquidCrystal(); //create and initialize a LiquidCrystal object to control an LCD
to:
LiquidCrystal lcd = LiquidCrystal(); //create a LiquidCrystal object to control an LCD
Changed lines 142-143 from:
digitalWrite(13,HIGH); //turn on an LED for debugging
to:
lcd.init(); //initialize the LCD
digitalWrite(13,HIGH); //turn on an LED for debugging
August 09, 2006, at 05:05 PM by Heather Dewey-Hagborg -
Changed line 17 from:
Download the LiquidCrystal library [[ Attach:LiquidCrystal.zip| here]].
to:
Download the LiquidCrystal library [[ Attach:LiquidCrystal.1.zip| here]].
August 09, 2006, at 05:04 PM by Heather Dewey-Hagborg -
Changed line 17 from:
Download the LiquidCrystal library
to:
Download the LiquidCrystal library [[ Attach:LiquidCrystal.zip| here]].
August 09, 2006, at 05:04 PM by Heather Dewey-Hagborg -
Changed line 17 from:
Download the LiquidCrystal library [[ Attach:LiquidCrystal.zip| here]].
to:
Download the LiquidCrystal library
August 09, 2006, at 05:03 PM by Heather Dewey-Hagborg -
Changed lines 66-67 from:
LiquidCrystal lcd = LiquidCrystal(); //create a LiquidCrystal object to control an LCD
to:
LiquidCrystal lcd = LiquidCrystal(); //create and initialize a LiquidCrystal object to control an LCD
Deleted line 68:
lcd.init(); //initialize the LCD
Added line 75:
Changed lines 87-88 from:
LiquidCrystal lcd = LiquidCrystal(); //create a LiquidCrystal object to control an LCD
to:
LiquidCrystal lcd = LiquidCrystal(); //create and initialize a LiquidCrystal object to control an LCD
Deleted line 89:
lcd.init(); //initialize the LCD
Changed line 114 from:
LiquidCrystal lcd = LiquidCrystal(); //create a LiquidCrystal object to control an LCD
to:
LiquidCrystal lcd = LiquidCrystal(); //create and initialize a LiquidCrystal object to control an LCD
Deleted line 117:
lcd.init(); //initialize the LCD
Added line 126:
Changed line 134 from:
LiquidCrystal lcd = LiquidCrystal(); //create a LiquidCrystal object to control an LCD
to:
LiquidCrystal lcd = LiquidCrystal(); //create and initialize a LiquidCrystal object to control an LCD
Deleted line 137:
lcd.init(); //initialize the LCD
August 02, 2006, at 08:25 PM by Heather Dewey-Hagborg -
Changed line 17 from:
Download the LiquidCrystal library[[ Attach:LiquidCrystal.zip| here]].
to:
Download the LiquidCrystal library [[ Attach:LiquidCrystal.zip| here]].
August 02, 2006, at 08:24 PM by Heather Dewey-Hagborg -
Changed line 17 from:
Download the LiquidCrystal library Attach:LiquidCrystal.zip[[ | here]].
to:
Download the LiquidCrystal library[[ Attach:LiquidCrystal.zip| here]].
August 02, 2006, at 08:23 PM by Heather Dewey-Hagborg -
Changed line 17 from:
Download the LiquidCrystal library [[Attach:LiquidCrystal.zip | here]].
to:
Download the LiquidCrystal library Attach:LiquidCrystal.zip[[ | here]].
August 02, 2006, at 07:22 PM by Heather Dewey-Hagborg -
Changed lines 18-19 from:
Unzip the files and place the whole LiquidCrystal folder inside your arduino-0004\lib\targets\libraries folder. Start the Arduino program and check to make sure LiquidCrystal is now available as an option in the Sketch menu under "import library".
to:
Unzip the files and place the whole LiquidCrystal folder inside your arduino-0004\lib\targets\libraries folder. Start the Arduino program and check to make sure LiquidCrystal is now available as an option in the Sketch menu under "Import Library".
August 02, 2006, at 07:20 PM by Heather Dewey-Hagborg -
Changed lines 17-18 from:
Attach:LiquidCrystal.zip
Download the LiquidCrystal library [[?? | here]].
to:
Download the LiquidCrystal library [[Attach:LiquidCrystal.zip | here]].
August 02, 2006, at 07:16 PM by Heather Dewey-Hagborg -
Added line 17:
Attach:LiquidCrystal.zip
August 02, 2006, at 07:14 PM by Heather Dewey-Hagborg -
Added lines 14-19:
!!!Install the Library

For a basic explanation of how libraries work in Arduino read [[http://www.arduino.cc/en/Main/Libraries | the library page]].
Download the LiquidCrystal library [[?? | here]].
Unzip the files and place the whole LiquidCrystal folder inside your arduino-0004\lib\targets\libraries folder. Start the Arduino program and check to make sure LiquidCrystal is now available as an option in the Sketch menu under "import library".
August 02, 2006, at 07:08 PM by Heather Dewey-Hagborg -
Changed line 146 from:
To interface an LCD directly in Arduino code see [[| this example]].
to:
To interface an LCD directly in Arduino code see [[http://www.arduino.cc/en/Tutorial/LCD8Bits | this example]].
August 02, 2006, at 07:08 PM by Heather Dewey-Hagborg -
Added lines 145-146:

To interface an LCD directly in Arduino code see [[| this example]].
August 02, 2006, at 07:04 PM by Heather Dewey-Hagborg -
Changed lines 127-131 from:
#include <LiquidCrystal.h>

LiquidCrystal lcd = LiquidCrystal();
char string1[] = "Hello!";
to:
#include <LiquidCrystal.h> //include LiquidCrystal library

LiquidCrystal lcd = LiquidCrystal(); //create a LiquidCrystal object to control an LCD
char string1[] = "Hello!"; //variable to store the string "Hello!"
Changed lines 133-134 from:
lcd.init();
digitalWrite(13,HIGH);
to:
lcd.init(); //initialize the LCD
digitalWrite(13,HIGH); //turn on an LED for debugging
Changed lines 137-141 from:
lcd.commandWrite(2);
delay(1000);
lcd.printIn(string1);
delay(1000);
}
to:
lcd.commandWrite(2); //bring the cursor to the starting position
delay(1000); //delay 1000 ms to view change
lcd.printIn(string1); //send the string to the LCD
delay(1000); //delay 1000 ms to view change
} //repeat forever
Changed lines 144-145 from:

Using this code makes the cursor jump back and forth between the end of the message an the home position.
to:
This code makes the cursor jump back and forth between the end of the message an the home position.
August 02, 2006, at 07:02 PM by Heather Dewey-Hagborg -
Changed lines 107-111 from:
#include <LiquidCrystal.h>

LiquidCrystal lcd = LiquidCrystal();
char string1[] = "Hello!";
to:
#include <LiquidCrystal.h> //include LiquidCrystal library

LiquidCrystal lcd = LiquidCrystal(); //create a LiquidCrystal object to control an LCD
char string1[] = "Hello!"; //variable to store the string "Hello!"
Changed lines 113-114 from:
lcd.init();
digitalWrite(13,HIGH);
to:
lcd.init(); //initialize the LCD
digitalWrite(13,HIGH); //turn on an LED for debugging
Changed lines 117-121 from:
lcd.clear();
delay(1000);
lcd.printIn(string1);
delay(1000);
}
to:
lcd.clear(); //clear the display
delay(1000); //delay 1000 ms to view change
lcd.printIn(string1); //send the string to the LCD
delay(1000); //delay 1000 ms to view change
} //repeat forever
August 02, 2006, at 06:59 PM by Heather Dewey-Hagborg -
Changed lines 79-82 from:
#include <LiquidCrystal.h>

LiquidCrystal lcd = LiquidCrystal();
to:
#include <LiquidCrystal.h> //include LiquidCrystal library

LiquidCrystal lcd = LiquidCrystal(); //create a LiquidCrystal object to control an LCD
Changed lines 84-85 from:
lcd.init();
digitalWrite(13,HIGH);
to:
lcd.init(); //initialize the LCD
digitalWrite(13,HIGH); //turn on an LED for debugging
Changed lines 89-91 from:
lcd.clear();
delay(1000);
lcd.print('a');
to:
lcd.clear(); //clear the display
delay(1000); //delay 1000 ms to view change
lcd.print('a'); //send individual letters to the LCD
Changed lines 94-95 from:
delay(1000);
}
to:
delay(1000);//delay 1000 ms to view change

} //repeat forever
August 02, 2006, at 06:45 PM by Heather Dewey-Hagborg -
Changed lines 58-61 from:
#include <LiquidCrystal.h>

LiquidCrystal lcd = LiquidCrystal();
to:
#include <LiquidCrystal.h> //include LiquidCrystal library

LiquidCrystal lcd = LiquidCrystal(); //create a LiquidCrystal object to control an LCD
Changed lines 63-64 from:
lcd.init();
digitalWrite(13,HIGH);
to:
lcd.init(); //initialize the LCD
digitalWrite(13,HIGH); //turn on an LED for debugging
Changed line 68 from:
delay(1000);
to:
delay(1000); //repeat forever
August 02, 2006, at 06:39 PM by Heather Dewey-Hagborg -
Changed lines 24-27 from:
Connect wires from the breadboard to the arduino input sockets. Look at the datasheet for your LCD board to figure out which pins are where. The pinout is as follows:
to:
Connect wires from the breadboard to the arduino input sockets. It is a lot of wires, so keep them as short and tidy as possible. Look at the datasheet for your LCD board to figure out which pins are where. Make sure to take note of whether the pin view is from the front or back side of the LCD board, you don't want to get your pins reversed!

The pinout is as follows:
Added line 56:
Changed lines 72-73 from:
If all went as planned both the LCD and the LED should turn on. Now you can use the potentiometer to adjust the contrast on the LCD until you can clearly see a cursor at the beginning of the first line.
to:
If all went as planned both the LCD and the LED should turn on. Now you can use the potentiometer to adjust the contrast on the LCD until you can clearly see a cursor at the beginning of the first line. If you turn the potentiometer too far in one direction black blocks will appear. Too far in the other direction everything will fade from the display. There should be a small spot in the middle where the cursor appears crisp and dark.
August 02, 2006, at 06:32 PM by Heather Dewey-Hagborg -
August 02, 2006, at 06:27 PM by Heather Dewey-Hagborg -
Changed lines 50-51 from:
First start by opening a new sketch in Arduino and saving it. Now go to the Sketch menu, scroll down to "import library", and choose "LiquidCrystal". The phrase #include should pop up at the top of your sketch.
to:
First start by opening a new sketch in Arduino and saving it. Now go to the Sketch menu, scroll down to "import library", and choose "LiquidCrystal". The phrase #include <LiquidCrystal.h> should pop up at the top of your sketch.
August 02, 2006, at 06:25 PM by Heather Dewey-Hagborg -
Changed lines 20-21 from:
Insert the LCD header into the breadboard and connect power and ground on the breadboard to power and ground from the microcontroller. On the Arduino module, use the 5V and any of the ground connections:
to:
Insert the LCD header into the breadboard and connect power and ground on the breadboard to power and ground from the microcontroller. On the Arduino module, use the 5V and any of the ground connections.
Changed lines 26-37 from:
Arduino LCD
2 Enable
3 Data Bit 0 (DB0)
4 (DB1)
5 (DB2)
6 (DB3)
7 (DB4)
8 (DB5)
9 (DB6)
10 (DB7)
11 Read/Write (RW)
12 Register Select (RS)
to:
Arduino LCD
2 Enable
3 Data Bit 0 (DB0)
4 (DB1)
5 (DB2)
6 (DB3)
7 (DB4)
8 (DB5)
9 (DB6)
10 (DB7)
11 Read/Write (RW)
12 Register Select (RS)
August 02, 2006, at 06:19 PM by Heather Dewey-Hagborg -
Changed lines 80-81 from:
lcd.init();
digitalWrite(13,HIGH);
to:
lcd.init();
digitalWrite(13,HIGH);
Added line 83:
Changed lines 85-90 from:
lcd.clear();
delay(1000);
lcd.print('a');
lcd.print('b');
lcd.print('c');
delay(1000);
to:
lcd.clear();
delay(1000);
lcd.print('a');
lcd.print('b');
lcd.print('c');
delay(1000);
Added lines 96-97:
Attach:abc_web.jpg
Added line 100:
[@
Added line 102:
Added line 105:
Changed lines 107-108 from:
lcd.init();
digitalWrite(13,HIGH);
to:
lcd.init();
digitalWrite(13,HIGH);
Changed lines 111-114 from:
lcd.clear();
delay(1000);
lcd.printIn(string1);
delay(1000);
to:
lcd.clear();
delay(1000);
lcd.printIn(string1);
delay(1000);
Changed lines 116-118 from:
}

Finally, you should know there is a lot of functionality in the HD44780 chip interface that is not drawn out into Arduino functions. If you are feeling ambitious glance over the datasheet and try out some of the direct commands using the commandWrite() function. For example, commandWrite(2) tells the board to move the cursor back to starting position.
to:
@]

Finally, you should know there is a lot of functionality in the HD44780 chip interface that is not drawn out into Arduino functions. If you are feeling ambitious glance over the datasheet and try out some of the direct commands using the commandWrite() function. For example, commandWrite(2) tells the board to move the cursor back to starting position. Here is an example:
Added line 122:
Added line 125:
Changed line 138 from:
Using this code makes the cursorjump back and forth between the end of the message an the home position.
to:
Using this code makes the cursor jump back and forth between the end of the message an the home position.
August 02, 2006, at 06:17 PM by Heather Dewey-Hagborg -
Changed lines 54-55 from:
#include
to:
#include <LiquidCrystal.h>
Added line 57:
Changed lines 70-72 from:
to:
Attach:cursor_2_web.jpg

Now let's try something a little more interesting. Compile and upload the following code to the Arduino.

[@
#include <LiquidCrystal.h>
Added line 78:
Changed lines 91-92 from:
}
to:
@]
Changed line 97 from:
#include
to:
#include <LiquidCrystal.h>
Changed line 114 from:
#include
to:
#include <LiquidCrystal.h>
August 02, 2006, at 06:14 PM by Heather Dewey-Hagborg -
Changed lines 3-4 from:
In this tutorial you will control a Liquid Crystal Display (LCD) using the Arduino LiquidCrystal library. The library provides functions for accessing any LCD using the common HD44780 parallel interface chipset, such as those available from Sparkfun. It currently implements 8-bit control and one line display of 5x7 characters. Functions are provided to initialize the screen, to print characters and strings, to clear the screen, and to send commands directly to the HD44780 chip. This tutorial will walk you through the steps of wiring an LCD to an Arduino microcontroller board and implementing each of these functions.
to:
In this tutorial you will control a Liquid Crystal Display (LCD) using the Arduino LiquidCrystal library. The library provides functions for accessing any LCD using the common HD44780 parallel interface chipset, such as those available from Sparkfun. It currently implements 8-bit control and one line display of 5x7 characters. Functions are provided to initialize the screen, to print characters and strings, to clear the screen, and to send commands directly to the HD44780 chip. This tutorial will walk you through the steps of wiring an LCD to an Arduino microcontroller board and implementing each of these functions.
Added line 25:
[@
Changed lines 38-39 from:
to:
@]
Changed line 53 from:
to:
[@
Changed lines 57-58 from:
lcd.init();
digitalWrite(13,HIGH);
to:
lcd.init();
digitalWrite(13,HIGH);
Added line 60:
Changed line 62 from:
delay(1000);
to:
delay(1000);
Changed lines 64-65 from:
}
to:
@]
August 02, 2006, at 06:12 PM by Heather Dewey-Hagborg -
Changed lines 1-2 from:
Arduino Liquid Crystal Display Interface
to:
!Arduino Liquid Crystal Library LCD Interface
Changed lines 7-15 from:
* Solderless breadboard
* Hookup wire
* Arduino Microcontoller Module
* Potentiometer
* Liquid Crystal Display (LCD) with HD44780 chip interface
* Light emitting Diode (LED) - optional, for debugging

Prepare the breadboard
to:
* Solderless breadboard
* Hookup wire
* Arduino Microcontoller Module
* Potentiometer
* Liquid Crystal Display (LCD) with HD44780 chip interface
* Light emitting Diode (LED) - optional, for debugging

!!!Prepare the breadboard
Added lines 22-23:
Attach:power_web.jpg
Added lines 38-39:
Attach:wires_web.jpg
Changed lines 42-45 from:
to:
Attach:pot_web.jpg

Additionally you may want to connect an LED for debugging purposes between pin 13 and Ground.

!!!Program the Arduino

First start by opening a new sketch in Arduino and saving it. Now go to the Sketch menu, scroll down to "import library", and choose "LiquidCrystal". The phrase #include should pop up at the top of your sketch.
August 02, 2006, at 05:45 PM by Heather Dewey-Hagborg -
Changed line 95 from:
to:
[@
Changed lines 100-101 from:
lcd.init();
digitalWrite(13,HIGH);
to:
lcd.init();
digitalWrite(13,HIGH);
Changed lines 104-107 from:
lcd.commandWrite(2);
delay(1000);
lcd.printIn(string1);
delay(1000);
to:
lcd.commandWrite(2);
delay(1000);
lcd.printIn(string1);
delay(1000);
Changed lines 109-110 from:
}
to:
@]
August 02, 2006, at 05:42 PM by Heather Dewey-Hagborg -
Added lines 1-111:

Share