Driving 16x2 LCD Display & Keeping Uno Pin 2 or 3 Free

Dan

You probably followed the Arduino Liquid Crystal Tutorial at http://arduino.cc/en/Tutorial/LiquidCrystal when you started tinkering with your LCD module. That tutorial happens to use these Arduino pins:

 * LCD RS pin to digital pin 12
 * LCD Enable pin to digital pin 11
 * LCD D4 pin to digital pin 5
 * LCD D5 pin to digital pin 4
 * LCD D6 pin to digital pin 3
 * LCD D7 pin to digital pin 2

And they are implemented with this code:

// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

If they had added an additional comment like this:

// initialize the library with the numbers of the interface pins
[color=red]// LiquidCrystal lcd(RS, E, D4, D5, D6, D7);[/color]
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

it would be a little clearer that you can use any available I/O pin, including the 'analog' pins, for any LCD line. All you have to do is make sure that the list in your LiquidCrystal lcd() statement matches the pins that you are using.

This is explained in the documentation, but you have to know where to look. It's here: LiquidCrystal - Arduino Reference

It is also in a similar location under the Arduino installation folder on your computer after you install the IDE.

Don