i am trying to connect my lcd keypad shield to my arduino, with jumoper wires
// include the library code:
#include <LiquidCrystal.h>
// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(8, 9, 4, 5, 6, 7);
void setup() {
// set up the LCD's number of columns and rows:
lcd.begin(16, 2);
// Print a message to the LCD.
lcd.setCursor(0,0);
lcd.print("LCD Key Shield");
lcd.setCursor(0,1);
lcd.print("Press Key:");
}
void loop() {
int x;
x = analogRead (0);
lcd.setCursor(10,1);
if (x < 60) {
lcd.print ("Right ");
}
else if (x < 200) {
lcd.print ("Up ");
}
else if (x < 400){
lcd.print ("Down ");
}
else if (x < 600){
lcd.print ("Left ");
}
else if (x < 800){
lcd.print ("Select");
}
}
i connect 4,5,6,7,8,9 from digital pins on the lcd to the digital pins from the arduino, and connected ground
with this code i am trying to get some text on the screen, but its blank.
If i put the lcd directly on the arduino its working ok.
WHat am i doing wrong?
sandoz:
i connect 4,5,6,7,8,9 from digital pins on the lcd to the digital pins from the arduino, and connected ground
with this code i am trying to get some text on the screen, but its blank.
If i put the lcd directly on the arduino its working ok.
WHat am i doing wrong?
The shield needs power and your sketch wants to use analog pin 0 so those pins (5v & A0) need to be hooked up as well.
Also there is more than one ground on the Arduino headers so I'd recommend hooking them both up.
At least read the first post which provides links to a test sketch to test the lcd keypad for the h/w issue and an alternate library (hd44780) that can work around the issue in s/w.
ok, with 5v i see the text
On the lcd i should be able to select settings from a small menu:
When i have the shied directly on the arduino it works ok, when i connect it with jumper wires, +5v, gnd, pin 4,5,6,7,8,9 and a0 it randomly goes through the buttons.
What could cause that?