controlling servo via keypad

Hi every one
I'm trying to control servo via keypad In order to determine the angle (position)
i want to input angle(position) by keypad
for example 120 then press # it will move to mentioned position
code as following :

#include "Keypad.h"
#include <Servo.h> 
Servo myservo;  // create servo object to control a servo 
                // a maximum of eight servo objects can be created 
 
char pos = 0;    // variable to store the servo position 
const byte ROWS = 4; //four rows
const byte COLS = 4; //four columns
char keys[ROWS][COLS] =
 {{'1','2','3'},
  {'4','5','6'},
  {'7','8','9'},
  {'*','0','#'}};
byte rowPins[ROWS] = {
  5, 4, 3, 2}; //connect to the row pinouts of the keypad
byte colPins[COLS] = {
   8, 7, 6}; //connect to the column pinouts of the keypad
int count=0;

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

void setup()
{
  Serial.begin(9600);
}

void loop()
{
  char key = keypad.getKey();
  if (key != NO_KEY)
  {
   pos = key;
     //Serial.print(key);
    if (key == '#')
    {
     myservo.write(pos);              // tell servo to go to position in variable 'pos' 
     delay(20); 
     Serial.print(pos);
    }
  }
}

is it dificult ?111
No body Knows =(

Meby some one did not understand my post ok i well explain more
In my previos code when i press 120 and then # just # will print on monitor
But i want if i press 120 and then i press # i want 120 will print on monitor how i do that please edite code to get what i want

If you read through your code, the only time you can get to your "output" is after you press #. Every other keystroke up to that point is lost. There is an argument in the servo library that does angles. I will post more later, because I need to go right now.

My Dear blcodemonkey
thats right
I will appreciate your cooperation
Thanks too much

#include "Keypad.h"
#include <Servo.h> 
Servo myservo;  // create servo object to control a servo 
                // a maximum of eight servo objects can be created 
int pos = 0;    // variable to store the servo position 
const byte ROWS = 4; //four rows
const byte COLS = 4; //four columns
char keys[ROWS][COLS] =
 {{'1','2','3'},
  {'4','5','6'},
  {'7','8','9'},
  {'*','0','#'}};
byte rowPins[ROWS] = {
  5, 4, 3, 2}; //connect to the row pinouts of the keypad
byte colPins[COLS] = {
   8, 7, 6}; //connect to the column pinouts of the keypad
int count=0;

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

void setup()
{
  Serial.begin(9600);
  myservo.attach(9);  // attaches the servo on pin 9 to the servo object 
}

void loop()
{
  char key = keypad.getKey();
  if (key != NO_KEY)
  {
  // pos = key;
     Serial.print(key);
    if (key == '#')
    {
     myservo.write(pos);              // tell servo to go to position in variable 'pos' 
     delay(20); 
     Serial.print(pos);
    }
  }
}

previeus code but I added: myservo.attach(9); // attaches the servo on pin 9 to the servo object

blcodemonkey
Im waiting your help
thanks

I'm hurry
please somebody help me because tomorrow i must hand over it

More than one week no Answer ?!

buddy just try this code after removing the lcd commands

#include <LiquidCrystal.h>
#include <Keypad.h>
#include <Servo.h>
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
Servo myservo; // create servo object to control a servo

const byte ROWS = 4; //four rows
const byte COLS = 4; //four columns
//define the symbols on the buttons of the keypads
char hexaKeys[ROWS][COLS] = {
{'1','2','3','A'},
{'4','5','6','B'},
{'7','8','9','C'},
{'*','0','#','D'}
};
byte rowPins[ROWS] = {6, 7, 8, 9}; //connect to the row pinouts of the keypad
byte colPins[COLS] = {A5, A4, A3, A2}; //connect to the column pinouts of the keypad

//initialize an instance of class NewKeypad
Keypad customKeypad = Keypad( makeKeymap(hexaKeys), rowPins, colPins, ROWS, COLS);
String value = "";

void setup(){
Serial.begin(9600);
myservo.attach(10); // attaches the servo on pin 9 to the servo object
lcd.begin(16, 2);

}

void loop(){
char customKey = customKeypad.getKey(); // get the key pressed
if(customKey=='D'){ // 'D' works as "enter"
//Serial.print("value: ");
//Serial.println(value);
int pos = value.toInt(); // convert value to int

myservo.write(pos); // rotate the servo
value = ""; // clear the string
}

if(customKey && customKey!= 'D'){ // if the key pressed is not 'D'
value = value + String(customKey); // concatenate the number to value
//Serial.println(value);
}
delay(50);
}