Hey guys, I've just started to put my own tester together and came across a smallish issue. Thought I would mention the problem and the fix.
It's probably something very simple for you Arduino guys, but for an inexperienced user like me took me a bit of time to figure it out
Basically I purchased a SainSmart Arduino and a compatible LCD module. The LCD was labelled "Drive the Future". I think this is classed as a "Robot" shield
I compiled the code and uploaded it as per Paul's instructions but I could not get the keys to work apart from "Right" and "Reset". I initally thought the shield was faulty however I tested this out and it was ok.
Looking into this, the keys are defined in
ArduinolibrariesDFR_KeyDFR_Key.cpp
e.g.
ifdef DF_ROBOT_V1
static int RIGHTKEY_ARV = 0; //that's read "analogue read value"
static int UPKEY_ARV = 98;
static int DOWNKEY_ARV = 254;
static int LEFTKEY_ARV = 407;
static int SELKEY_ARV = 638;
static int NOKEY_ARV = 1023;
#else
static int RIGHTKEY_ARV = 0;
static int UPKEY_ARV = 144;
static int DOWNKEY_ARV = 329;
static int LEFTKEY_ARV = 505;
static int SELKEY_ARV = 742;
static int NOKEY_ARV = 1023;
Now it says the Robot is defined but these values would not work for me so I had to figure out a way to output the values which were on mine, as I had no idea what they were. I could then comment out the #else values and define my own.
Using the example (1) on this
website I modified the code to do just that using the code for each button:
lcd.print(analogRead(0));
Anyway I've attached the sketch that I've modified so it will allow you to test your LCD and will also give you the analog values for each key press if someone has the same issues
Hope it helps!
https://www.ukvac.com/forum/data/uploads/665/sketch_feb22a.zip
Purity2017-02-23 23:23:05