key pressed value error

I am trying to input any value using a keypad and decrements the value but when i am displaying the value i am getting 255 for any key pressed. How can i solve this problem. here is a piece of code below

customKey = customKeypad.waitForKey();
        if(customKey){
          Minutes[Data_count] = customKey; 
          lcd.setCursor(Data_count,1); 
          lcd.print(Minutes[Data_count]); 
          delay(1000);
          lcd.clear();
           x = Minutes;
           i = (x);
           lcd.print(i);
           delay(1000);
           lcd.clear();
           for(c = i; c>=0; c--){
            
            delay(1000);
            lcd.print(c);
            delay(1000);
            lcd.clear();
            }
            lcd.print("done");
            delay(1000);

How can i solve this problem. here is a piece of code

Here is a piece of advice

Post a complete program that illustrates the problem

Is this you trying to input the time your process needs to run, and to run it for that time, as discussed elsewhere?

If so, the code I already gave you in #20 of your "keypad project" thread yesterday has a delay()-less solution.

this is my complete code

#include <Wire.h> 
#include "DFRobot_RGBLCD.h"
#include <Keypad.h>

#define MachineNumber 9
#define TimeInMinutes 4 // to user must convert hours to minutes before entering 
char Machine[MachineNumber] = {'1','2','3','4','5','6','7','8','9'};
char Minutes[TimeInMinutes];
char JobNumber1 = '1';
char JobNumber2 = '2';
char JobNumber3 = '3';
char JobNumber4 = '4';
char JobNumber5 = '5';
char customKey;
byte Data_count = 0;
int x;


const byte ROWS = 4;
const byte COLS = 4;

char hexaKeys[ROWS][COLS] = {
  {'1', '4', '7', '*'},
  {'2', '5', '8', '0'},
  {'3', '6', '9', '#'},
  {'A', 'B', 'C', 'D'}
};

byte rowPins[ROWS] = {9, 8, 7, 6};
byte colPins[COLS] = {5, 4, 3, 2};

Keypad customKeypad = Keypad(makeKeymap(hexaKeys), rowPins, colPins, ROWS, COLS);

DFRobot_RGBLCD lcd(16, 2);  

void setup(){
  lcd.init(); 
  
 
}

void loop(){
  lcd.setCursor(0,0);
  lcd.print("ENTER MACH NO.");

  customKey = customKeypad.getKey();
  for(byte i = 0; i < MachineNumber; i++) {
    if(customKey == Machine[i]){
      lcd.setCursor(0,1);
      lcd.print(customKey);
      delay (1000);
      lcd.clear();
      lcd.print("Machine Number");
      lcd.print(customKey);
      delay(1000);
      lcd.clear();
      lcd.print("Enter Job No.");
      lcd.setCursor(0,1);
      customKey = customKeypad.waitForKey();
      if(customKey == JobNumber1){
        lcd.print("DYE LOT SEL.");
        delay(1000);
        lcd.clear();
        lcd.print("ENTER TIME");
        customKey = customKeypad.waitForKey();
        if(customKey){
          Minutes[Data_count] = customKey; 
          lcd.setCursor(Data_count,1); 
          lcd.print(Minutes[Data_count]); 
          Data_count++; 
          
          } 
        }
      else if (customKey == JobNumber2){
            lcd.print("D/CREEL SEL.");
            delay(1000);
            lcd.clear();
            lcd.print("ENTER TIME");
            customKey = customKeypad.waitForKey();
            if(customKey){
          Minutes[Data_count] = customKey; 
          lcd.setCursor(Data_count,1); 
          lcd.print(Minutes[Data_count]); 
          Data_count++; 
          
          } 
     
        }
      else if  (customKey == JobNumber3){
            lcd.print("PACK SEL.");
            delay(1000);
            lcd.clear();
            lcd.print("ENTER TIME");
            customKey = customKeypad.waitForKey();
            if(customKey){
          Minutes[Data_count] = customKey; 
          lcd.setCursor(Data_count,1); 
          lcd.print(Minutes[Data_count]); 
          Data_count++; 
          
          } 
     
        }
        else if  (customKey == JobNumber4){
            lcd.print("CREEL SEL.");
            delay(1000);
            lcd.clear();
            lcd.print("ENTER TIME");
            customKey = customKeypad.waitForKey();
            if(customKey){
          Minutes[Data_count] = customKey; 
          lcd.setCursor(Data_count,1); 
          lcd.print(Minutes[Data_count]); 
          Data_count++; 
          
          } 
     
        } 
         else if  (customKey == JobNumber5){
            lcd.print("CUT/TIE SEL SEL.");
            delay(1000);
            lcd.clear();
            lcd.print("ENTER TIME");
            customKey = customKeypad.waitForKey();
            if(customKey){
          Minutes[Data_count] = customKey; 
          lcd.setCursor(Data_count,1); 
          lcd.print(Minutes[Data_count]); 
          Data_count++; 
          
          } 
     
        }
    }  
    
  }  
}

"Is this you trying to input the time your process needs to run, and to run it for that time, as discussed elsewhere?"

yes i want to enter the time it takes to finish the job number and decrements that time and when it equal to zero sound the siren to indicate that time up job is finished.and the alarm should be cleared by the password

Blue10:
yes i want to enter the time it takes to finish the job number and decrements that time and when it equal to zero sound the siren to indicate that time up job is finished.and the alarm should be cleared by the password

Ok well the password part is new- you didn't mention that in the other thread- so my code there uses a button to silence the siren.

But my code in that other thread does show how to take a multi-digit integer into a variable. In the case of the time, it delay()-lessly checks to see if the time has expired and then ends the process (I just had an led on) then sounds the siren. (My code doesn't show how much of the time has passed or how much is left, but I daresay that could be accommodated easily enough if it's a requirement.)