2 numbers from KEYPAD and show them in the LCD

Hi,

I would like to take from the keypad 2 separate numbers (they must be separate because the program will deal with each one individually) then make them appear in the LCD. But the problem is that the numbers looks like symbols in the LCD.

A pic of the LCD in the attachments

And this is my code:

#include <Keypad.h>
#include <LiquidCrystal.h>

#define KEYPAD_STATE 1
#define DISPLAY_STATE 2
#define DO_NOTHING 3

const byte ROWS = 4; //four rows
const byte COLS = 3; //three columns
char keys[ROWS][COLS] =
{ {‘1’, ‘2’, ‘3’},
{‘4’, ‘5’, ‘6’},
{‘7’, ‘8’, ‘9’},
{’*’, ‘0’, ‘#’}
};

byte rowPins[ROWS] = {
23, 25, 27, 29
}; //connect to the row pinouts of the keypad
byte colPins[COLS] = {
31, 33, 35
}; // connect to the column pinouts of the keypad
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

int count = 0;
int state = KEYPAD_STATE;

Keypad keypad = Keypad( makeKeymap(keys), rowPins, colPins, ROWS, COLS );

void setup()
{
lcd.begin(16, 2);
lcd.print(" You Entered");
lcd.setCursor(5, 1);
}

void loop()
{
char key1 = 0, key2 = 0;

switch (state) {
case KEYPAD_STATE:

//Get first key
keypad.waitForKey();
key1 = keypad.getKey();
//Get second key
keypad.waitForKey();
key2 = keypad.getKey();

//Move into next state
state = DISPLAY_STATE;
break;
case DISPLAY_STATE:
lcd.setCursor(5,1);
lcd.print(key1);
lcd.setCursor(6,1);
lcd.print(“Then”);
lcd.print(key2);
lcd.setCursor(5, 1);
//Move into next state (Here it is do nothing, you should go to phase that does what you need to do after displaying the keys)
state = DO_NOTHING;
break;

}
}

This may help

http://forum.arduino.cc/index.php?topic=116793.0

Weedpharma