LCD keypad shield with arduino uno

I had the same issue. I couldn't get my program to count. Thanks to everyone on this thread, I was able to get it to work. I noticed though no one uploaded the complete working code. For this to work you need an Arduino UNO and a LCD keypad shield from DFRobot (DFR0009), at least that what I used. You also have to make sure what version of the LCD keypad you have, and uncomment/comment the code accordingly.

//Using LiquidCrystal library
#include <LiquidCrystal.h>
 
/*******************************************************
 
This program will add a value and display it.  To increment
use the UP and DOWN button.

Please make sure what version of the LCD Keypad Shield you are using and uncomment
the correct threshold area.


//George Ferrao
//george.ferrao@scarabware.com

*******************************************************/
 
// select the pins used on the LCD panel
LiquidCrystal lcd(8, 9, 4, 5, 6, 7);
 
// define some values used by the panel and buttons
int lcd_key     = 0;
int adc_key_in  = 0;

#define btnUP     1
#define btnDOWN   2

 
// declair funtion to read the buttons

int read_LCD_buttons()
{
 adc_key_in = analogRead(0);      // read the value from the sensor
 
 // For V1.1 us this threshold
 /*
 if (adc_key_in < 250)  return btnUP; 
 if (adc_key_in < 450)  return btnDOWN; 
*/ 
 
 // For V1.0 comment the other threshold and use the one below:
  
 if (adc_key_in < 195)  return btnUP; 
 if (adc_key_in < 380)  return btnDOWN;
}
 
void setup()
{
 lcd.begin(16, 2); // start the library
}
  
void loop()
{
 
 lcd_key = read_LCD_buttons();
 static int value = 0;
 if(lcd_key == 1)
  {
    value = constrain(value+1,-30,30);  // I only wanted it to count from (-30)-(+30) and back
  }
 else if (lcd_key == 2)
  {
    value = constrain(value-1,-30,30);  // I only wanted it to count from (-30)-(+30_)and back
  }
  
  lcd.setCursor(4,0);
  lcd.print("COUNT: ");
  lcd.setCursor(11,0);
  lcd.print(value); // displays the count
  lcd.print(" ");  //This space is here to clear the double digit area.
  
  delay(150);
}