I've got a 2x16 LCD + keypad shield plugged into a Uno and can't get it to respond properly. With the shield plugged into the Uno the top row of digits is off and the bottom row shows up as a row of solid squares.
Right up front I have zero coding experience so all I'm doing is using example sketches but even with those the LCD isn't doing what it's supposed to.
E.g., I created a sketch using:
// include the library code:
#include <LiquidCrystal.h>
// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
void setup() {
// set up the LCD's number of columns and rows:
lcd.begin(16,2);
}
void loop() {
// set the cursor to (0,0):
lcd.setCursor(0, 0);
// print from 0 to 9:
for (int thisChar = 0; thisChar < 10; thisChar++) {
lcd.print(thisChar);
delay(500);
}
// set the cursor to (16,1):
lcd.setCursor(16,1);
// set the display to automatically scroll:
lcd.autoscroll();
// print from 0 to 9:
for (int thisChar = 0; thisChar < 10; thisChar++) {
lcd.print(thisChar);
delay(500);
}
// turn off automatic scrolling
lcd.noAutoscroll();
// clear screen for the next loop:
lcd.clear();
}
but the screen remains as it was when first plugged in. Can anyone tell me what I'm doing wrong?
(Sorry for the ugly code paste. What's the right way to do that?)
EDIT: Thanks. That looks better.