I received my LCD Keypad Shield last week from Dealextreme. This post briefly summarises some useful information regarding the tweaks required to the standard Arduino library for controlling LCD panels.
The LCD Keypad module contains a 16×2 (characters x rows) LCD display and assorted pushbuttons on a PCB designed to plug on to an Arduino Uno (and similar Arduino variants). With suitable external wiring, the module can also be driven by an Arduino Nano.
Dealextreme’s website says it has a “blue backlight with white words”. It does. However, the LCD panel’s contrast control (a multi-turn trim pot) needs to be twisted many turns before you can properly see the text if you’re running the underlying Arduino from a USB port (i.e. 5V supply).
PCB pinout & existing LCD library
The Arduino IDE 1.0.1 comes with a suitable LiquidCrystal library for driving LCD shields. However, the example sketches (such as
Examples->LiquidCrystal->AutoScroll) assume different Arduino pins are being used to drive the LCD shield.
To drive this particular LCD Keypad Shield when plugged directly into your Uno, adjust the following configuration line in the example sketches:
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
LiquidCrystal lcd(8, 9, 4, 5, 6, 7);
With this change made, the
Examples->LiquidCrystal->AutoScroll sketches compiled and ran just fine.
The backlight brightness is tied to Arduino’s pin 10 (a PWM output), and can be adjusted with
analogWrite (10, fadeValue);
0 <= fadeValue <= 255.
Analog input A0 sees a voltage proportional to the button being pressed (use
button = analogRead(0)). This is somewhat simplistic — each button puts a different analog voltage on A0, but it appears there’s no way to detect multiple concurrent button presses.
The Dealextreme unit seems earily similar to this design from DFRobot, both in terms of PCB layout and which Arduino pins are mapped to what functions on the LCD panel itself.
See http://www.ladyada.net/learn/lcd/charlcd.html and http://www.freetronics.com/pages/16×2-lcd-shield-quickstart-guide for additional details about Arduino control of similar LCD panels.