Ok, thanks for the help so far.
I should go back and summarise the sequence of what I have done so far.
My description implies some shortcuts that would take overly long to document.
- This is where I started, downloading the software, installing it and getting the UNO board to work blinking the L led.
-
Then I mounted the SainSmart keypadLCD Shield on the board, and tried to run the LiquidDisplay example "Blink"
-
When I compiled the code, errors abounded, so I started looking for answers, by going to Sainsmart's product page.
http://www.sainsmart.com/sainsmart-1602-lcd-keypad-shield-for-arduino-duemilanove-uno-mega2560-mega1280.html#customer-reviews
- The product page gave me the example and library code, which I downloaded as keypad_lcd.zip , unzipped and picked the \keypad_lcd\LCD1602for_023\lcdkeypad folder and dropped it into the "Libraries" folder, and tried again, after including <lcdkeypad.h> in the "Blink." sketch, and making the corrections as detailed below. The errors reduced considerably.
I also found this in one of the product reviews:
To get the demo code to work, you need to replace
#include "WProgram.h"
with
#include "Arduino.h"
as that has now been updated, and as someone else mentioned this shield uses different pins from most others so you need to change
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
to
LiquidCrystal lcd(8, 9, 4, 5, 6, 7);
- From CattleDog:
Remove the 0 from the end of the link to find the sainsmart web page - DONE
When you get this to compile, you will need to change the lcd constructor to LiquidCrystal lcd(8, 9, 4, 5, 6, 7) because that is the way the pins on the shield are configured to the lcd. - DONE
This is a common shield, and is similar to others with the Right push button label Rigth. - OK - HANDY TO KNOW WHEN I GET THAT FAR.
You do not need the LCDKeypad.h to get this running. That library is very simple and basically gives the analog read values for each button. You will learn more if you do not even use this library. You can use analog read to find the values for your actual shield and program the button selection accordingly. - YOU'VE LOST ME, I JUST WANT TO GET THIS SHIELD TO BLINK.
Are you using the LiquidCrystal.h library which came with the IDE, or are you using something you downloaded - SOURCE IS GIVEN ABOVE.
Latest version of my modified "Blink" Code, with the compilation results:
/*
LiquidCrystal Library - Blink
Demonstrates the use a 16x2 LCD display. The LiquidCrystal
library works with all LCD displays that are compatible with the
Hitachi HD44780 driver. There are many of them out there, and you
can usually tell them by the 16-pin interface.
This sketch prints "Hello World!" to the LCD and makes the
cursor block blink.
The circuit:
* 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
* LCD R/W pin to ground
* 10K resistor:
* ends to +5V and ground
* wiper to LCD VO pin (pin 3)
Library originally added 18 Apr 2008
by David A. Mellis
library modified 5 Jul 2009
by Limor Fried (http://www.ladyada.net)
example added 9 Jul 2009
by Tom Igoe
modified 22 Nov 2010
by Tom Igoe
This example code is in the public domain.
http://arduino.cc/en/Tutorial/LiquidCrystalBlink
*/
#include <Arduino.h>
#include <LCDKeypad.h>
// 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.print("hello, world!");
}
void loop() {
// Turn off the blinking cursor:
lcd.noBlink();
delay(3000);
// Turn on the blinking cursor:
lcd.blink();
delay(3000);
}
Results:
C:\Program Files (x86)\Arduino\hardware\tools\avr\bin\avr-g++ -c -g -Os -Wall -fno-exceptions -ffunction-sections -fdata-sections -mmcu=atmega328p -DF_CPU=16000000L -MMD -DUSB_VID=null -DUSB_PID=null -DARDUINO=105 -IC:\Program Files (x86)\Arduino\hardware\arduino\cores\arduino -IC:\Program Files (x86)\Arduino\hardware\arduino\variants\standard -IC:\Program Files (x86)\Arduino\libraries\LCDKeypad -IC:\Program Files (x86)\Arduino\libraries\LiquidCrystal C:\Users\seb\AppData\Local\Temp\build2937333908715505494.tmp\Blink_V1.cpp -o C:\Users\seb\AppData\Local\Temp\build2937333908715505494.tmp\Blink_V1.cpp.o
In file included from Blink_V1.ino:42:
C:\Program Files (x86)\Arduino\libraries\LCDKeypad/LCDKeypad.h:18: error: expected class-name before '{' token
Hopefully it gives the cognoscenti a clearer picture of my problem.