Intro: LCD Keypad Shield Reset Button Mod
Have you bought a DFRobot LCD Keypad Shield for Arduino and thought it would be cool if the reset button wasn't a reset button, but could be used by your Arduino code just like the other buttons? Here's an easy mod that makes that possible with only minor changes to the board hardware.
(NOTE: I've only tried this mod on V1.0 of the LCD Keypad Shield, but see no reason why it shouldn't work on the V1.1 board.)
What you need:
Needle nose pliers
Heat shrink tubing a suitable gauge and length to cover the resistor.
Step 1: Remove the Reset Pin
You have two choices on how to remove the reset pin from the LCD shield. You can either cut the pin, or desolder and remove it. Cutting the pin is probably the easiest and fastest method, but desoldering looks a little cleaner. Desoldering the pin requires a pair of needle nosed pliers.
Step 2: Add the Resistor
The above photo shows both the top and the bottom of the board aligned to make it easier to see what's going on. The resistor is soldered between the select switch and the empty hole right next to where the reset pin was removed. Solder one end of the resistor to both of the two far terminals of the select switch (on the underside of the board.) Cut a piece of heat shrink tubing, or a small piece of cable insulation to an appropriate length to cover both wire ends of the resistor and the resistor body. There should be just enough wire end left on the resistor to solder it into the RST hole.
Step 3: Modify the Example Code
I will show how to modify the example Arduino code found at the DFRobot product wiki to work with the modification.
In the defines section add a new constant for the reset switch:
#define btnRIGHT 0
#define btnUP 1
#define btnDOWN 2
#define btnLEFT 3
#define btnSELECT 4
#define btnRESET 5 // add reset
#define btnNONE 6// renumber from 5 to 6
Change the default return value of the read_LCD_buttons() function:
// return btnNONE; // when all others fail, return this...
return btnRESET; // any remaining value less than 1000 should be due to reset button press
Add a case to the switch block of the main loop() function.
Here's the complete modified example. Don't forget to change code in the read_LCD_buttons() function if you are using V1.0.