KeyPad, liquidCrystal auto "restart"

Hello, it is the first time I write here for help...

I have my proyect finished and I just need to turn the lequidCristal screen off if a there is a number of seconds without someone typing any key from the keypad...

I think it is important to say that on my sketch, "restart" means to ejecute the function "codeRequest" which leave the screen off until someone push a key form the keypad

here you can se the sketch and I hope you can help me... very thankfull!

void setup() {
pinMode(pinRele, OUTPUT);

lcd.init();
lcd.init();
codeRequest();

}

void loop(){

keyPressed = myKeyboard.getKey();
if (keyPressed) { // Si se ha pulsado una tecla.
if (keyPressed >= '0' && keyPressed <= '9' && digitNumber < 4){ //Si se pulsa una tecla entre 0 y 9 y hay menos de 4 dígitos pulsados.
digitNumber ++;
codePressed = codePressed + keyPressed;
}
if (keyPressed == 'A'){ //Si se Pulsa A ejecuta codeRequest.
codeRequest();
digitNumber = 0;
codePressed = "";
}
if (keyPressed == 'B' && digitNumber > 0){
delateNumber(); //Borra el último caracter siempre que haya alguno tecleado.
}
if (keyPressed == 'C'){ // Borra todos los caracteres introducidos.
digitNumber = 0;
codePressed = "";
}
//Este código evalua la clave introducida.
if (digitNumber == 4){ // Cuando se han introducido los 4 dígitos
if (codePressed == pinRobert){ //Se comparan con la contraseña y si es correcta:
correctCode();
}else { // Si no es idéntica:
errorCode();
}
codePressed = ""; //Se resetea la variable
digitNumber = 0; //Se resetea la variable
}else { // Si aún no se han introducido 4 caracteres:
insertCode();
}
}

}

// Es la instrucción inicial, deja la pantalla "apagada" hasta que se pulse una tecla
void codeRequest(){
lcd.noBacklight();
lcd.clear();
myKeyboard.waitForKey();
lcd.backlight();
lcd.setCursor(5,0);
lcd.print("BIENVENIDO");
lcd.setCursor(0,2);
lcd.print("Introduzca su clave:");
}

// Mientras no se escriban 4 dígitos imprime asteriscos en pantalla.
void insertCode(){
lcd.clear();
lcd.backlight();
lcd.setCursor(5,0);
lcd.print("BIENVENIDO");
lcd.setCursor(0,2);
lcd.print("Introduzca su clave:");
lcd.setCursor(8,3);
if (digitNumber == 1){
lcd.print("");
}else if (digitNumber == 2){
lcd.print("");
}else if (digitNumber == 3){
lcd.print("
");
}
}

// Cuando el código introducido coresponde con la clave elegida
void correctCode(){
lcd.clear();
lcd.backlight();
lcd.setCursor(5,0);
lcd.print("BIENVENIDO");
lcd.setCursor(0,2);
lcd.print("Correcto! Adelante.");

digitalWrite(pinRele, HIGH);
delay(1500);
digitalWrite(pinRele, LOW);
codeRequest();
}

// Cuando el código introducido NO corresponde con la clave
void errorCode(){
lcd.clear();
lcd.backlight();
lcd.setCursor(0,0);
lcd.print("");
lcd.setCursor(5,1);
lcd.print("INCORRECTO");
lcd.setCursor(0,2);
lcd.print("VUELVA A INTENTARLO");
lcd.setCursor(0,3);
lcd.print("
");
delay(3000);
codeRequest();
}

// Borra dígito a dígito introducido
void delateNumber(){
digitNumber --;
codePressed = codePressed.substring(0, digitNumber);
lcd.backlight();
lcd.setCursor(5,0);
lcd.print("BIENVENIDO");
lcd.setCursor(0,2);
lcd.print(codePressed);
}

void timeOff(){
timeVariation = millis() - preTime;
preTime = millis();
if (timeVariation > workingTimeLimit){
codeRequest();
}
}

Your code is likely incomplete (global variables, includes,..)

Study blink without delay or the post anchored at the top of the forum on how to use millis()
=> basically you need to keep a variable unsigned long lastTimeUserAction; which you update with the value of millis() every time someone touches the keypad and then at the start of the loop you check if it has been too long ago in which case you turn off the lcd

if (lcdIsON && (millis()-lastTimeUserAction >= SCREEN_TEMPO)) {
  lcdIsON = false.
  lcd.noBacklight();
}

Whilst you are at the top of the forum, read the forum rules and correct your post above and add code tags around your code:
[code]`` [color=blue]// your code is here[/color] ``[/code].

It should look like this:// your code is here
(Also press ctrl-T (PC) or cmd-T (Mac) in the IDE before copying to indent your code properly)