Sainsmart 1602 LCD shield causes sketch to run incorrectly

Before realizing I shouldn't have, I bought one of these LCD keypad shields. I have been able to make it work with other things happening, specifically, a motor driver shield, and a sensor shield. So I know all about problems getting things to play nicely. ... and my soldering skills are getting better all the time! :smiley:

ok... I open up a successful sketch... let's check out my defined pins:

#define EN1_PIN 3
#define EN2_PIN 11
#define DIR1_PIN 12
#define DIR2_PIN 13
// int a0 = 0; // CANNOT USE: pin 0 is key input from LCD!
int a1 = 0; // this has +Vcc connected to sense for max ADC value
int a2 = 0; // PF1C / PF3C connector
// int a3 = 0; // CANNOT USE: pin 3 is PWM for motor CHA
int a4 = 0; // PF09 connector
//////////////////////////////////////////////////////////////////
//LCD setup using LiquidCrystal library
#include <LiquidCrystal.h>
#define LCD_BACKLITE_PIN 10
// select the pins used on the LCD panel
LiquidCrystal lcd(8, 9, 4, 5, 6, 7);

Right off, I'm seeing that your pins are different from mine in the LiquidCrystal instantiation, so that's possibly your problem.

Other pins I'm using above: Digital pins 3,11,12,13 for stepper motor shield; Analog pins 2 and 4 for throttle position sensors that I'm testing; and I briefly had pin 1 shorted to prove to myself that 1024 on the ADC is in fact +Vcc.

Note that digital pin 10 is separately declared; this was so I could do whatever the software fix they said to do in the other posting.

I use this keypad shield as the user interface, making my Arduino test bench autonomous. I did end up using a Mega for the bigger RAM and more pins. My next revision is to use Adafruit's 1.8 TFT w/ joystich shield as the UI for my "stack".

:slight_smile: Chris