Reconocimiento pulsación botón muy lento

Buenos días amigos, tengo un problema con un teclado matricial de 4x4, resulta que arduino tarda mucho tiempo en detectar la pulsación de los botones, alguien tiene alguna solución?
Adjunto el código completo, gracias de antemano

#include <DS1307RTC.h>
#include <Time.h>
#include <OneWire.h>   //SE INCLUYE LA LIBRERIA ONEWIRE PARA LA SONDA DS18B20
#include <Wire.h>
#include <DallasTemperature.h>   //SE DECLARA LA LIBRERIA PARA LA SONDA DS18B20
#include <LiquidCrystal.h>
#include <Keypad.h>
#define ONE_WIRE_BUS 13  //SE DEFINE EL PIN DATA DE LA SONDA DS18B20
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

OneWire oneWire(ONE_WIRE_BUS);

DallasTemperature sensors(&oneWire);

float tempC = 0;
bool fallotemp = false;
bool calentador = false;
bool luz = false;
bool ventiladores = false;
bool rgb = false;

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

char hexaKeys [ROWS] [COLS] = {
  {'1','2','3','A'},
  {'4','5','6','B'},
  {'7','8','9','C'},
  {'*','0','#','D'}
};
byte rowPins[ROWS] = {22, 23, 24, 25}; //connect to the row pinouts of the keypad
byte colPins[COLS] = {26, 27, 28, 29}; //connect to the column pinouts of the keypad

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



void setup(){
lcd.begin(16, 2);                            // SE DECLARA LAS DIMENSIONES DE LA PANTALLA LCD
sensors.begin();                             //SE INICIALIZA EL SENSOR
pinMode(30, OUTPUT);                         // SE DECLARA PIN 30 COMO SALIDA     "CALENTADOR"   
pinMode(31, OUTPUT);                         // SE DECLARA EL PIN 31 COMO SALIDA  "LUZ"
pinMode(32, OUTPUT);                         // SE DECLARA EL PIN 32 COMO SALIDA "VENTILADORES"
pinMode(33, OUTPUT);                         // SE DECLARA EL PIN 33 COMO SALIDA "LUZ NOCHE AZUL"
pinMode(34, OUTPUT);                         // SE DECLARA EL PIN 34 COMO SALIDA "RGB"
setSyncProvider(RTC.get);                   // Vamos a usar el RTC
setSyncInterval(86400000);                  // Sincronizo una vez cada 24 horas
digitalWrite(30, HIGH);  
digitalWrite(31, HIGH);
digitalWrite(32, HIGH);
digitalWrite(33, HIGH);
digitalWrite(34, HIGH);
}

void loop(){
sensors.requestTemperatures();
tempC = sensors.getTempCByIndex(0);
  delay(50);
  lcd.setCursor(2,1);
  lcd.print(tempC);
  lcd.setCursor(8,1);
  lcd.print("Grados");
  

char customKey = customKeypad.getKey();
 
      if(customKey == '1'){               // SI LA TECLA PULSDA ES IGUAL A 1
        calentador = true;                // ACTIVAMOS CALENTADOR
        lcd.setCursor(0,0);               // POSICIONAMOS EL CURSOR EN EL CARACTER 1, FILA 0
        lcd.print(" Calentador ON  ");      // SE IMPRIME EL TEXTO EN LA PANTALLA LCD
        delay(1000);                       // RETARDO DE 500MS
        lcd.clear();                      // SE LIMPIA LA PANTALLA
        
      }

     if (customKey == '4'){
       calentador = false;
       lcd.setCursor(0,0);
       lcd.print(" Calentador OFF");
       digitalWrite(30, HIGH);
       delay(1000);
       lcd.clear();
       
     }
        
      if (calentador == true && tempC <= 20.0){          // SI CALENTADOR ESTA ACTIVADO Y LA TEMPERATURA ES MENOR QUE 20ºC ACTIVAMOS EL PIN 30
        digitalWrite(30, LOW);
        lcd.setCursor(0,0);
        lcd.print("CALENTANDO AGUA ");
      }
      

      if (calentador == true && tempC >= 21.0){
        lcd.setCursor(0,0);
        lcd.print(" Temperatura OK ");
        digitalWrite(30, HIGH);
      }
        
       if (calentador == true && tempC<= 12.00){
          fallotemp = true;
          lcd.setCursor(0,0);
          lcd.print("Fallo Calentador");
          
       }
         else{
          fallotemp = false;
         }

       if (tempC>= 22.00){
        lcd.setCursor(0,0);
        lcd.print("                ");
        lcd.setCursor(0,0);
        lcd.print("Temp Excesiva");
       }
 

       
      if(customKey == 'A'){
        lcd.setCursor(0,0);
        lcd.print("                ");
        luz = true; 
        lcd.setCursor(5,0);
        lcd.print("LUZ ON");
        delay(1000);
        lcd.setCursor(0,0);
        lcd.print("            ");
        
      }

     if (customKey == 'B'){
       lcd.setCursor(0,0);
       lcd.print("                ");
       luz = false;
       lcd.setCursor(5,0);
       lcd.print("LUZ OFF");
       delay(1000);
       lcd.setCursor(0,0);
       lcd.print("            ");
       
     }
        
     
  
      //if (calentador == true && luz == true){         // "PRUEBA"==> SI CALENTADOR ESTA ACTIVADO Y LUZ TAMBIEN SE MUESTRA MENSAJE EN PANTALLA
         //lcd.setCursor(0,0);                          // ESTA PRUEBA LA REALIZO PARA UTILIZARLA DE TAL MANERA "SI CALENTADOR == TRUE && tempC<=20" SOLO SE ACTIVARA EL PIN 30 CUANDO AMBOS SEAN VERDADEROS
         //lcd.print("Prueba OK");
     // }
 
    if (customKey == '#'){                           // SI SE PULSA LA TECLA # APARECE EN PANTALLA EL SIGNIFICADO DE LAS TECLAS "A, B, C, D"
      lcd.setCursor(0,0);                            // DESPUES DE UN RETARDO FINAL SE LIMPIA LA PANTALLA
      lcd.print("1 Calentador ON");
      lcd.setCursor(0,1);
      lcd.print("4 Calentador OFF");
      delay(2000);
      lcd.clear();
      lcd.setCursor(0,0);
      lcd.print("A LUZ ON");
      lcd.setCursor(0,1);
      lcd.print("B LUZ OFF");
      delay(2000);
      lcd.clear();
      lcd.setCursor(0,0);                           
      lcd.print("C Ventilador ON");
      lcd.setCursor(0,1);
      lcd.print("D Ventilador OFF");
      delay(2000);
      lcd.clear();
      lcd.setCursor(0,0);                           
      lcd.print("2 Leds RGB ON");
      lcd.setCursor(0,1);
      lcd.print("5 Leds RGB OFF");
      delay(2000);  
      lcd.clear();   
      
      
    }

  if (customKey == 'C'){
    lcd.setCursor(0,0);
    lcd.print("                ");
    ventiladores = true;
    lcd.setCursor(0,0);
    lcd.print("Ventiladores On");
    delay(1000);
    lcd.setCursor(0,0);
    lcd.print("                ");
    
  }

  if (customKey == 'D'){
    lcd.setCursor(0,0);
    lcd.print("                ");
    ventiladores = false;
    lcd.setCursor(0,0);
    lcd.print("Ventiladores Off");
    delay(1000);
    lcd.setCursor(0,0);
    lcd.print("                ");
    
  }

    if (customKey == '2'){
    lcd.setCursor(0,0);
    lcd.print("                ");
    rgb = true;
    lcd.setCursor(2,0);
    lcd.print("Leds RGB ON");
    delay(1000);
    lcd.setCursor(0,0);
    lcd.print("                ");
  }

 if (customKey == '5'){
    lcd.setCursor(0,0);
    lcd.print("                ");
    rgb = false;
    lcd.setCursor(2,0);
    lcd.print("Leds RGB OFF");
    delay(1000);
    lcd.setCursor(0,0);
    lcd.print("                ");
 }



  if (rgb == true){
    digitalWrite(34, LOW);
  }
   else{
    digitalWrite(34, HIGH);
   }


  if (ventiladores == true && tempC >= 21.00){
    digitalWrite(32, LOW);
    
  }
  else{
    digitalWrite(32, HIGH);
  }


  if (luz == false){
    digitalWrite(33, HIGH);
    
  }


  if (esHora()&& luz == true) {
    digitalWrite(31, LOW);
    digitalWrite(33, HIGH);
    delay(500);
  }else{
    digitalWrite(31, HIGH);
    if (luz == true){
      digitalWrite(33, LOW);
    }
    delay(500);
  }
}
  
 boolean  esHora() {
  //Defino horas Inicio a las 19:30 y termina a las 21:00
  byte horaInicio = 19;
  byte minutoInicio = 22;
  byte horaFin = 19;
  byte minutoFin = 23;

  //Para hacer las comparaciones de cuando empezar y cuando terminar, lo paso todo a minutos.

  int momentoInicio = (horaInicio * 60) + minutoInicio;
  int momentoFin = (horaFin * 60) + minutoFin;
  int momentoAhora = (hour() * 60) + minute();

  //Esto es que si hemos pasado o estamos en el momento de inicio , pero antes del momento del fin…
  if ((momentoInicio <= momentoAhora) && (momentoAhora < momentoFin)) {
    //devolver "Cierto" en esta función "esHora"
    return true;
  } else {
    //devolver "Falso" en esta función "esHora"
    return false;
  }
}

Tu código esta plagado de delay y cuando se ejecuta uno no responde el teclado.
Presionas 1 tienes un delay de 1000 mseg
Presionas 2 tienes un delay de 1000 mseg
Presionas 4 tienes un delay de 1000 mseg
Presionas 5 tienes un delay de 1000 mseg
Presionas A tienes un delay de 1000 mseg
Presionas B tienes un delay de 1000 mseg
Presionas # tienes un delay de 2000 mseg
Presionas C tienes un delay de 1000 mseg
Presionas D tienes un delay de 1000 mseg

Es lo que debes esperar a que actue.
Debes trabajar de otro modo, y ese modo es millis()
Ahora su reemplazo de no es directo.

Gracias surbyte, como cambio el delay por millis?, solo se cambia la linea del delay? o hay que cambiar mas cosas?

No, el cambio no es nada simple.
Hay que practicamente dar vuelta todo el código.
Eso si te va a quedar como una rallo.
Dejame ver si puedo aconsejarte o es mas complicado.

Me puse a verlo y ahora comprendo, es tu respuesta en programación a no usar un menú!!
Claro..

Bueno voy a verlo mas tarde porque dará mucho trabajo.

Gracias surbyte, espero tu comentario

Bueno hemos hecho grandes cambios en tu código asi que lo resumo acá

#include <DS1307RTC.h>
#include <Time.h>
#include <OneWire.h>   //SE INCLUYE LA LIBRERIA ONEWIRE PARA LA SONDA DS18B20
#include <Wire.h>
#include <DallasTemperature.h>   //SE DECLARA LA LIBRERIA PARA LA SONDA DS18B20
#include <LiquidCrystal.h>
#include <Keypad.h>

#define CALENTADOR    30    // SE DECLARA PIN 30 COMO SALIDA     "CALENTADOR"
#define LUZ           31    // SE DECLARA EL PIN 31 COMO SALIDA  "LUZ"
#define RGB           32    // SE DECLARA EL PIN 32 COMO SALIDA "RGB"
#define VENTILADORES  33    // SE DECLARA EL PIN 33 COMO SALIDA "VENTILADORES REFRIGERACION AGUA"

#define ONE_WIRE_BUS 13  //SE DEFINE EL PIN DATA DE LA SONDA DS18B20
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

OneWire oneWire(ONE_WIRE_BUS);

DallasTemperature sensors(&oneWire);

float tempC = 0;
bool fallotemp = false;
bool  calentador = false;
bool luz = false;
bool rgb = false;
bool ventiladores = false;
const byte ROWS = 4;
const byte COLS = 4;

String strAgua, strRes, strRGB, strVent, strLuz;

char hexaKeys [ROWS] [COLS] = {
  {'1','2','3','A'},
  {'4','5','6','B'},
  {'7','8','9','C'},
  {'*','0','#','D'}
};
byte rowPins[ROWS] = {22, 23, 24, 25}; //connect to the row pinouts of the keypad
byte colPins[COLS] = {26, 27, 28, 29}; //connect to the column pinouts of the keypad

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



void setup(){
lcd.begin(20, 4);                           // SE DECLARA LAS DIMENSIONES DE LA PANTALLA LCD
sensors.begin();                            //SE INICIALIZA EL SENSOR
pinMode(CALENTADOR, OUTPUT);                        // SE DECLARA PIN 30 COMO SALIDA     "CALENTADOR"   
pinMode(LUZ,  OUTPUT);                        // SE DECLARA EL PIN 31 COMO SALIDA  "LUZ"
pinMode(RGB,  OUTPUT);                        // SE DECLARA EL PIN 32 COMO SALIDA "RGB"
pinMode(VENT, OUTPUT);                        // SE DECLARA EL PIN 33 COMO SALIDA "VENTILADORES REFRIGERACION AGUA"
digitalWrite(CALENTADOR, HIGH);                     // Apago calentador

setSyncProvider(RTC.get);                // Vamos a usar el RTC
setSyncInterval(86400000);               // Sincronizo una vez cada 24 horas

}

void loop(){
  sensors.requestTemperatures();
  tempC = sensors.getTempCByIndex(0);

  lcd.setCursor(3,3);
  lcd.print(tempC);
  lcd.setCursor(11,3);
  lcd.print("Grados");
  

  char customKey = customKeypad.getKey();

  switch (customKey){

      case '1': calentador = true;
                break;
      case 'A': calentador = false;
                fallotemp = false;
                lcd.setCursor(2,2);
                lcd.print("                 ");
                break;    
      case '7': luz = true;
                break;
      case '8': luz = false;
                break;
      case '9': rgb = true;
                break; 
      case '6': rgb = false;
                break;  
      case '5': ventiladores = true;
                break;
      case '2': ventiladores = false;
                break; 
      default: break;                                                                     
  }
  
  resistencia();
  iluminacion();
  ledrgb();
  refrigeracion();
  display();
}

 boolean  esHora() {
  //Defino horas Inicio a las 19:30 y termina a las 21:00
  byte horaInicio   = 12;
  byte minutoInicio = 03;
  byte horaFin      = 12;
  byte minutoFin    = 04;

  //Para hacer las comparaciones de cuando empezar y cuando terminar, lo paso todo a minutos.

  int momentoInicio = (horaInicio * 60) + minutoInicio;
  int momentoFin    = (horaFin * 60) + minutoFin;
  int momentoAhora  = (hour() * 60) + minute();

  //Esto es que si hemos pasado o estamos en el momento de inicio , pero antes del momento del fin…
  if ((momentoInicio <= momentoAhora) && (momentoAhora < momentoFin)) 
       return true;          //devolver "Cierto" en esta función "esHora"
  else     
       return false;           //devolver "Falso" en esta función "esHora"
}

void resistencia(){
  if (!fallotemp) {
      if (calentador)   
          strRes = "Res ON ";                     // POSICIONAMOS EL CURSOR EN EL CARACTER 1, FILA 0
      else
          strRes = "Res OFF";
  }

  if (calentador) {
      if (tempC >= 23.0){
          digitalWrite(CALENTADOR, HIGH);
          strAgua = " Temperatura OK ";
      }

      if (tempC <= 22.0 && !fallotemp) {          // SI CALENTADOR ESTA ACTIVADO Y LA TEMPERATURA ES MENOR QUE 20ºC ACTIVAMOS EL PIN 30
          digitalWrite(CALENTADOR, LOW);
          strAgua = "CALENTANDO AGUA ";
      }  
        
      if (tempC<= 19.00){
          fallotemp = true;
          strAgua = "Error Temperatura"; 
          calentador = false;    
      } 
  }  
}   


void iluminacion(){
       
  if (luz){  
      strLuz = "Luz On ";
  else
      strLuz = "Luz Off";
  }
        
  if (esHora() && luz) 
      digitalWrite(LUZ, LOW);
  else 
      digitalWrite(LUZ, HIGH);
}

void ledrgb(){
   
  if (rgb){
      digitalWrite(RGB, LOW);
      strRGB = "Rgb On ";
  } 
  else {
      digitalWrite(RGB, HIGH);
      strRGB = "Rgb Off";
  }
}

void refrigeracion(){ 

  if (ventiladores){
      strVen = "Vent On ";
      if (tempC>= 25.0){
          digitalWrite(VENT, LOW);
      }
      else{
          digitalWrite(VENT, HIGH);
      }
  }
  else {
      strVen = "Vent Off";
      digitalWrite(VENT, HIGH);   
  }
}

void display() {
  lcd.setCursor(0,0);               // POSICIONAMOS EL CURSOR EN EL CARACTER 1, FILA 0
  lcd.print(strRes);
  lcd.setCursor(11,0);
  lcd.print(strVent);  
  lcd.setCursor(0,1);
  lcd.print(strLuz);
  lcd.setCursor(11,1);
  lcd.print(strRGB); 
  lcd.setCursor(2,2);
  lcd.print(strAgua);
}

Dime como lucen e incluso si el problema del arranque se resuelve con lo que agregué en el setup.

Para los que no entiendan como pasamos del post inicial a esto, hemos conversador algo por privado pero solo saltamos un paso que luego zapata explicará.
Solo le mostré que es importante organizar mejor todo para entender que esta pasando.
El código inicial luce caótico por mas que funcione, es complejo de entender y todos incluso yo hemos hecho cosas asi al principio.
Pero una buena técnica de programación incluye el separara las cosas en tareas mas simples e independientes donde podamos por ejemplo desactivarlas con un simple comentario.
Supongamos que falle iluminacion() pues solo lo comantan // y el resto funcionará y podrán entonces ver que ocurre con esa parte.

Tampoco usen pines con sus números porque de nuevo, el código se vuelve dificil de leer con el tiempo.
Comenten las lineas por la misma razón!!

Muchas gracias por la reforma Surbyte, me salen errores al compilar

C:\Users\Antonio\Desktop\Control_Pecera_Modificado_4_reforma_ricardo\Control_Pecera_Modificado_4_reforma_ricardo.ino: In function 'void loop()':

Control_Pecera_Modificado_4_reforma_ricardo:97: error: 'ledrgb' was not declared in this scope

   ledrgb();

          ^

Control_Pecera_Modificado_4_reforma_ricardo:98: error: 'refrigeracion' was not declared in this scope

   refrigeracion();

                 ^

Control_Pecera_Modificado_4_reforma_ricardo:99: error: 'display' was not declared in this scope

   display();

           ^

C:\Users\Antonio\Desktop\Control_Pecera_Modificado_4_reforma_ricardo\Control_Pecera_Modificado_4_reforma_ricardo.ino: At global scope:

Control_Pecera_Modificado_4_reforma_ricardo:158: error: expected unqualified-id before 'if'

   if (esHora() && luz) 

   ^

Control_Pecera_Modificado_4_reforma_ricardo:160: error: expected declaration before '}' token

   }else{ 

   ^

Bien, Antoniio, coloca como lo hemos resuelto por ahora y seguimos adelante.

Bueno aquí dejo el código sin errores de compilación, sigo haciendo pruebas para ver que todo funciona, y dar siempre las gracias a gente como surbyte por ayudar a gente que quiere aprender en este mundo

#include <DS1307RTC.h>
#include <Time.h>
#include <OneWire.h>   //SE INCLUYE LA LIBRERIA ONEWIRE PARA LA SONDA DS18B20
#include <Wire.h>
#include <DallasTemperature.h>   //SE DECLARA LA LIBRERIA PARA LA SONDA DS18B20
#include <LiquidCrystal.h>
#include <Keypad.h>

#define CALENTADOR    30    // SE DECLARA PIN 30 COMO SALIDA     "CALENTADOR"
#define LUZ           31    // SE DECLARA EL PIN 31 COMO SALIDA  "LUZ"
#define RGB           32    // SE DECLARA EL PIN 32 COMO SALIDA "RGB"
#define VENTILADORES  33    // SE DECLARA EL PIN 33 COMO SALIDA "VENTILADORES REFRIGERACION AGUA"

#define ONE_WIRE_BUS 13  //SE DEFINE EL PIN DATA DE LA SONDA DS18B20
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

OneWire oneWire(ONE_WIRE_BUS);

DallasTemperature sensors(&oneWire);

float tempC = 0;
bool fallotemp = false;
bool  calentador = false;
bool luz = false;
bool rgb = false;
bool ventiladores = false;
const byte ROWS = 4;
const byte COLS = 4;

String strAgua, strRes, strRGB, strVent, strLuz;

char hexaKeys [ROWS] [COLS] = {
  {'1','2','3','A'},
  {'4','5','6','B'},
  {'7','8','9','C'},
  {'*','0','#','D'}
};
byte rowPins[ROWS] = {22, 23, 24, 25}; //connect to the row pinouts of the keypad
byte colPins[COLS] = {26, 27, 28, 29}; //connect to the column pinouts of the keypad

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

void refrigeracion();
void ledrgb();
void iluminacion();
void resistencia();
void displayLCD();

void setup(){
lcd.begin(20, 4);                           // SE DECLARA LAS DIMENSIONES DE LA PANTALLA LCD
sensors.begin();                            //SE INICIALIZA EL SENSOR
pinMode(CALENTADOR, OUTPUT);                        // SE DECLARA PIN 30 COMO SALIDA     "CALENTADOR"   
pinMode(LUZ,  OUTPUT);                        // SE DECLARA EL PIN 31 COMO SALIDA  "LUZ"
pinMode(RGB,  OUTPUT);                        // SE DECLARA EL PIN 32 COMO SALIDA "RGB"
pinMode(VENTILADORES, OUTPUT);                        // SE DECLARA EL PIN 33 COMO SALIDA "VENTILADORES REFRIGERACION AGUA"
digitalWrite(CALENTADOR, HIGH);                     // Apago calentador

setSyncProvider(RTC.get);                // Vamos a usar el RTC
setSyncInterval(86400000);               // Sincronizo una vez cada 24 horas

}

void loop(){
  sensors.requestTemperatures();
  tempC = sensors.getTempCByIndex(0);

  lcd.setCursor(3,3);
  lcd.print(tempC);
  lcd.setCursor(11,3);
  lcd.print("Grados");
  

  char customKey = customKeypad.getKey();

  switch (customKey){

      case '1': calentador = true;
                break;
      case 'A': calentador = false;
                fallotemp = false;
                lcd.setCursor(2,2);
                lcd.print("                 ");
                break;    
      case '7': luz = true;
                break;
      case '8': luz = false;
                break;
      case '9': rgb = true;
                break; 
      case '6': rgb = false;
                break;  
      case '5': ventiladores = true;
                break;
      case '2': ventiladores = false;
                break; 
      default: break;                                                                     
  }
  
  resistencia();
  iluminacion();
  ledrgb();
  refrigeracion();
  displayLCD();
}

 boolean  esHora() {
  //Defino horas Inicio a las 19:30 y termina a las 21:00
  byte horaInicio   = 12;
  byte minutoInicio = 03;
  byte horaFin      = 12;
  byte minutoFin    = 04;

  //Para hacer las comparaciones de cuando empezar y cuando terminar, lo paso todo a minutos.

  int momentoInicio = (horaInicio * 60) + minutoInicio;
  int momentoFin    = (horaFin * 60) + minutoFin;
  int momentoAhora  = (hour() * 60) + minute();

  //Esto es que si hemos pasado o estamos en el momento de inicio , pero antes del momento del fin…
  if ((momentoInicio <= momentoAhora) && (momentoAhora < momentoFin)) 
       return true;          //devolver "Cierto" en esta función "esHora"
  else     
       return false;           //devolver "Falso" en esta función "esHora"
}

void resistencia(){
  if (!fallotemp) {
      if (calentador)   
          strRes = "Res ON ";                     // POSICIONAMOS EL CURSOR EN EL CARACTER 1, FILA 0
      else
          strRes = "Res OFF";
  }

  if (calentador) {
      if (tempC >= 23.0){
          digitalWrite(CALENTADOR, HIGH);
          strAgua = " Temperatura OK ";
      }

      if (tempC <= 22.0 && !fallotemp) {          // SI CALENTADOR ESTA ACTIVADO Y LA TEMPERATURA ES MENOR QUE 20ºC ACTIVAMOS EL PIN 30
          digitalWrite(CALENTADOR, LOW);
          strAgua = "CALENTANDO AGUA ";
      }  
        
      if (tempC<= 19.00){
          fallotemp = true;
          strAgua = "Error Temperatura"; 
          calentador = false;    
      } 
  }  
}   


void iluminacion(){
       
  if (luz){  
      strLuz = "Luz On ";
  }else{
      strLuz = "Luz Off";
  }

  if (esHora() && luz) 
      digitalWrite(LUZ, LOW);
  else
      digitalWrite(LUZ, HIGH);
}
void ledrgb(){
   
  if (rgb){
      digitalWrite(RGB, LOW);
      strRGB = "Rgb On ";
  } 
  else {
      digitalWrite(RGB, HIGH);
      strRGB = "Rgb Off";
  }
}

void refrigeracion(){ 

  if (ventiladores){
      strVent = "Vent On ";
      if (tempC>= 25.0){
          digitalWrite(VENTILADORES, LOW);
      }
      else{
          digitalWrite(VENTILADORES, HIGH);
      }
  }
  else {
      strVent = "Vent Off";
      digitalWrite(VENTILADORES, HIGH);   
  }
}

void displayLCD() {
  lcd.setCursor(0,0);               // POSICIONAMOS EL CURSOR EN EL CARACTER 1, FILA 0
  lcd.print(strRes);
  lcd.setCursor(11,0);
  lcd.print(strVent);  
  lcd.setCursor(0,1);
  lcd.print(strLuz);
  lcd.setCursor(11,1);
  lcd.print(strRGB); 
  lcd.setCursor(2,2);
  lcd.print(strAgua);
}