I'm not sure what is going on here, Keypad input

Hi I am very new to this and am building a game device that takes user input from a serial keypad and displays it on an LCD, part of this input is a time represented by hours minutes and seconds. I have managed to figure things out up to this point but have hit a bit of a wall, I am struggling understanding why the value being returned from the key pad is what it is and also the timer function in arduino language in general.

Below is the part of the code I am using to get the digit input from the keypad, display it on screen and the store the value in a variable called hours. I have managed to validate the user input and limited the LCD display to 99:59:59 which is what I want. When I press 1 I get a 1 appear on the LCD but when I make hours = key I get the ascii value returned, I have tried using atoi but get an error when compiling(error: invalid conversion from 'char' to 'const char*') not sure whats going on there as I am trying to take the ascii value and turn it into an integer, apparently it doesn't do what it says on the tin...

can someone help here, I want hours, minutes and seconds as integers to be used in a count down timer

int hours = 0;
 int minutes = 0;
 int seconds = 0;
 int posPlace = 0;
 Serial.begin(9600);      // open the serial port at 9600 bps: 
 
 while(gameTimeSet == 0) // stay here and perform this loop until the user has entered a valid time and pressed # to confirm
  {

    char key = keypad.getKey();
    if (key == 42) // if the key pressed is * clear the screen
        {
         caller = SetTimeScreen();
         posPlace = 0;
        }
    else if(key >= '0' && key <= '9') 
      {
        if (posPlace == 0 )
          {
            lcd.setCursor(posPlace,1);
            lcd.print(key);
            hours = key;
            posPlace = 1;
            lcd.setCursor(posPlace,1);
            Serial.print(hours);
          }
        else if (posPlace == 1)
          { 
            lcd.print(key);
            hours = hours * 10 + key;
            posPlace = 3;
            lcd.setCursor(posPlace,1);
            Serial.print(hours);
          }

Also if someone can give me a few pointers to get me going on the count down to display the count down happening in real-time on the LCD, I have really tried to find something, for example i checked the numerous timer libraries and the EventFuse one but I don't quite get them

Thanks a mill for any help

Dexter

Show all of your code is going to be necessary in order to get much help so you might as well do it now.

Hi, I managed to figure this out, I had to minus 48 from the value of key when storing it in the integer. After that it worked fine.