Nextion problem with arduino

Hello, i´m starting a project with arduino mega and nextion and i have problems when i use the function
popcallback. i´m sending some variables to nextion, clock, temperature, ph, two progressive bars etc.
On this project i have 4 pages and i checked when i change to one page without theses variables the nextion return the code 1A FF FF FF . On arduino i´m sending the values to page 1 only.

I think popcallback don´t work because bus is busy with return data and don´t read popcallback operations.
I need some help. Thanks in advance.

#include <EEPROM.h>
#include <Nextion.h>
#include <SoftwareSerial.h>   // Library for Software Serial Port
#define espacoEEPROM 4000   //4Kb para arduino mega, 1k para arduino uno



// parametros RTC
#include <virtuabotixRTC.h>   
#define   clk   6
#define   dat   7
#define   rst   8
#define   segL       19
#define   minL       45
#define   horL       19
#define   d_semL      6
#define   d_mesL     24
#define   mesL        6
#define   anoL     2019


char data_temperatura;
char datas_serial;
char buffer[10];
float temperature;

//valores a memorizar na eeprom ////////////////////////
//endereço de memória para guardar o valor do set tempetatura
int address1 = 0; //inicializa o valor de temperatura no endereço 0 da eeprom

////// endereços de memoria para as funções automáticas##############################################################
////feed
int address2 = 10; //inicializa o valor da hora ligar feed
int address3 = 20; //inicializa o valor do minuto ligar feed



/////bomba filtro

int address6 = 50; //inicializa o valor da hora ligar bomba
int address7 = 60; // inicializa o valor do minuto ligar bomba
int address8 = 70; // inicializa o valor da hora desligar bomba
int address9 = 80; // inicializa o valor do minuto desligar bomba

///// iluminação


int address10 = 90; //inicializa o valor da hora ligar iluminacao
int address11 = 100; //inicializa o valor do minuto ligar iluminacao
int address12 = 110; //inicializa o valor da hora desligar iluminacao
int address13 = 120; //inicializa o valor do minuto desligar iluminacao



int settemp; // inicializa a valiável temperatura do set temperatura


// valores variáveis função automática
//feed
int horafeedligar;
int minutofeedligar;


//bomba
int horabombaligar;
int minutobombaligar;
int horabombadesligar;
int minutobombadesligar;


//iluminação
int horailuminacaoligar;
int minutoiluminacaoligar;
int horailuminacaodesligar;
int minutoiluminacaodesligar;


void EEPROMWriteInt(int address, int value); //2 Bytes
int  EEPROMReadInt(int address);




//===========================================================================
// MANUAL BUTTONS



int variable1 = 0;  // Create a variable to have a counter going up by one on each cycle
int counter = 0;  // Create a variable to have a counter for the + and - buttons
int CurrentPage = 0;



//envio dos valores temp,horas,etc para  nextion

NexNumber d_val = NexNumber(3, 8, "settemp");
NexText vel_val  = NexText(0, 11, "t3");
NexNumber temp_digit  = NexNumber(0, 23, "n0");    
NexProgressBar j0 = NexProgressBar(0, 2, "j0");
NexProgressBar j1 = NexProgressBar(0, 3, "j1");
NexText ph_val  = NexText(0, 4, "t1");

//envio de valores para programador
//feed
NexNumber horafeedligar_val = NexNumber(1, 51, "n10");
NexNumber minutofeedligar_val = NexNumber(1, 52, "n12");
//bomba filtro
NexNumber horabombaligar_val = NexNumber(1, 35, "n14");
NexNumber minutobombaligar_val = NexNumber(1, 36, "n16");
NexNumber horabombadesligar_val = NexNumber(1, 37, "n15");
NexNumber minutobombadesligar_val = NexNumber(1, 38, "n17");
//iluminação
NexNumber horailuminacaoligar_val = NexNumber(1, 19, "n18");
NexNumber minutoiluminacaoligar_val = NexNumber(1, 20, "n20");
NexNumber horailuminacaodesligar_val = NexNumber(1, 21, "n19");
NexNumber minutoiluminacaodesligar_val = NexNumber(1, 22, "n21");

//declaração de botões set temp
NexButton b1 = NexButton(3, 6, "b1"); //botão de set temperature +
NexButton b2 = NexButton(3, 7, "b2"); //botão de -

// decalaração de botões para programação automática
// feed
NexButton b100 = NexButton(1, 41, "b100"); //botão de hora + feed on
NexButton b101 = NexButton(1, 43, "b101"); //botão de hora - feed on
NexButton b104 = NexButton(1, 42, "b104"); //botão de minuto + feed on
NexButton b105 = NexButton(1, 46, "b105"); //botão de minuto - feed on
//bomba filtro
NexButton b108 = NexButton(1, 31, "b108"); //botão de hora + bomba on
NexButton b109 = NexButton(1, 33, "b109"); //botão de hora - bomba on
NexButton b110 = NexButton(1, 23, "b110"); //botão de hora + bomba off
NexButton b111 = NexButton(1, 25, "b111"); //botão de hora - bomba off
NexButton b112 = NexButton(1, 32, "b112"); //botão de minuto + bomba on
NexButton b113 = NexButton(1, 34, "b113"); //botão de minuto - bomba on
NexButton b114 = NexButton(1, 24, "b113"); //botão de minuto + bomba off
NexButton b115 = NexButton(1, 26, "b114"); //botão de minuto - bomba off
//iluminação
NexButton b116 = NexButton(1, 48, "b116"); //botão de hora luz on
NexButton b117 = NexButton(1, 17, "b117"); //botão de hora luz on
NexButton b118 = NexButton(1, 3, "b118"); //botão de hora luz off
NexButton b119 = NexButton(1, 47, "b119"); //botão de hora luz off
NexButton b120 = NexButton(1, 49, "b120"); //botão de minuto  luz on
NexButton b121 = NexButton(1, 18, "b121"); //botão de minuto  luz on
NexButton b122 = NexButton(1, 4, "b122"); //botão de minuto luz off
NexButton b123 = NexButton(1, 5, "b123"); //botão de minuto luz off



NexDSButton bt0 = NexDSButton(2, 5, "bt0");  // Dual state bomba filtro
NexDSButton bt1 = NexDSButton(2, 6, "bt1");  // Dual state alimentador
NexDSButton bt2 = NexDSButton(2, 7, "bt2");  // Dual state iluminação



NexTouch *nex_listen_list[] = 
{

&b1, // botão + do set temp
&b2, // botão - do set temp

//botoes do temporizador
&b100,
&b101,
&b104,
&b105,
&b108,
&b109,
&b110,
&b111,
&b112,
&b113,
&b114,
&b115,
&b116,
&b117,
&b118,
&b119,
&b120,
&b121,
&b122,
&b123,

 
&bt0,  // bt0 bt1 bt2 botões dual state para controlos manuais
&bt1,  
&bt2,  
  
  
 
  
    NULL  // String terminated
};  // End of touch event list
//botoes para incremento-decremento do set temperature do nextion


  void b1PopCallback(void *ptr)  // Release event for button b1
{
 
  settemp= settemp + 1;

  if(settemp >40)  // proteção temperatura máxima
  {settemp = 40;
  }
  
  EEPROM.write(0, settemp);
}  // End of release event
  
  void b2PopCallback(void *ptr)  // Release event for button b2
{
  
  settemp= settemp - 1;
  if(settemp < 0)  // proteção temperatura mínima 
  {settemp = 0;
  EEPROM.write(0, settemp);
  }
  
 
}  // End of release event

/////botoes programacao automatica /////////////////////////////////////////////////////////////////////////////7

void b100PopCallback(void *ptr)  // Release event for button 
{
  horafeedligar = horafeedligar + 1;
   
   if(horafeedligar > 23)
   {horafeedligar = 0;
   EEPROM.write(10, horafeedligar);
   }
     
 
}  // End of release event

void b101PopCallback(void *ptr)  // Release event for button 
{
  horafeedligar = horafeedligar - 1;
  
   if(horafeedligar < 0)
   {horafeedligar = 23;
   EEPROM.write(10, horafeedligar);
   }
    
   
}  // End of release event



void b104PopCallback(void *ptr)  // Release event for button 
{
  
  minutofeedligar = minutofeedligar + 1;
  
  if(minutofeedligar > 59)
  {minutofeedligar = 0;
  
  EEPROM.write(20, minutofeedligar);
  }
  
}  // End of release event


void b105PopCallback(void *ptr)  // Release event for button 
{
    minutofeedligar = minutofeedligar - 1;
    
  if(minutofeedligar < 0)
  {minutofeedligar = 59 ;
    EEPROM.write(20, minutofeedligar);
  }
  

}  // End of release event




void b108PopCallback(void *ptr)  // Release event for button 
{

  horabombaligar= horabombaligar + 1;
  
  if(horabombaligar > 23)
   {horabombaligar = 0;
   EEPROM.write(50, horabombaligar);
   }
   
  
}  // End of release event


void b109PopCallback(void *ptr)  // Release event for button 
{
 
  horabombaligar = horabombaligar - 1;
  
    if(horabombaligar < 0)
    {horabombaligar = 23;
      EEPROM.write(50, horabombaligar);
     }
   

}  // End of release event


void b110PopCallback(void *ptr)  // Release event for button 
{

  horabombadesligar = horabombadesligar + 1;
  if(horabombadesligar > 23)
   {horabombadesligar = 0;
    EEPROM.write(70, horabombadesligar);
   }
 
}  // End of release event


void b111PopCallback(void *ptr)  // Release event for button 
{
  
  horabombadesligar = horabombadesligar - 1;
  
  if(horabombadesligar < 0)
   {horabombadesligar = 23;
     EEPROM.write(70, horabombadesligar);
   }
   

}  // End of release event


void b112PopCallback(void *ptr)  // Release event for button 
{
 
  minutobombaligar= minutobombaligar + 1;
   if(minutobombaligar > 59)
  {minutobombaligar = 0;
  
  EEPROM.write(60, minutobombaligar);
  }
  
}  // End of release event


void b113PopCallback(void *ptr)  // Release event for button 
{
  minutobombaligar= minutobombaligar - 1;
  if(minutobombaligar < 0)
  {minutobombaligar = 59;
    EEPROM.write(60, minutobombaligar);
  }

}  // End of release event



void b114PopCallback(void *ptr)  // Release event for button 
{
 
  minutobombadesligar = minutobombadesligar + 1;
   if(minutobombadesligar > 59)
  {minutobombadesligar = 0;
  EEPROM.write(80, minutobombadesligar);
  }
  
}  // End of release event


void b115PopCallback(void *ptr)  // Release event for button
{
   minutobombadesligar = minutobombadesligar - 1;
   if(minutobombadesligar < 0)
  {minutobombadesligar = 59;
  EEPROM.write(80, minutobombadesligar);
  }
  
}  // End of release event


void b116PopCallback(void *ptr)  // Release event for button 
{
  
  horailuminacaoligar = horailuminacaoligar + 1;
  
  if(horailuminacaoligar > 23)
   {horailuminacaoligar = 0;
    EEPROM.write(90, horailuminacaoligar);
   }
   
 
}  // End of release event


void b117PopCallback(void *ptr)  // Release event for button 
{
 
  horailuminacaoligar = horailuminacaoligar - 1;
  
  if(horailuminacaoligar < 0)
   {horailuminacaoligar = 23 ;
    EEPROM.write(90, horailuminacaoligar);
   }
   
    
}  // End of release event


void b118PopCallback(void *ptr)  // Release event for button 
{
 
  horailuminacaodesligar = horailuminacaodesligar + 1;
  
  if(horailuminacaodesligar > 23)
   {horailuminacaodesligar = 0;
   
  EEPROM.write(110, horailuminacaodesligar);
   }
   
}  // End of release event


void b119PopCallback(void *ptr)  // Release event for button 
{

  horailuminacaodesligar = horailuminacaodesligar - 1;
  
  if(horailuminacaodesligar < 0)
   {horailuminacaodesligar = 23;
   EEPROM.write(110, horailuminacaodesligar);
   }
   
  
}  // End of release event



void b120PopCallback(void *ptr)  // Release event for button 
{
  
  minutoiluminacaoligar = minutoiluminacaoligar + 1;
   if(minutoiluminacaoligar > 59)
  {minutoiluminacaoligar = 0;
  EEPROM.write(100, minutoiluminacaoligar);
  }
  
}  // End of release event


void b121PopCallback(void *ptr)  // Release event for button 
{
   minutoiluminacaoligar = minutoiluminacaoligar - 1;
   if(minutoiluminacaoligar < 0)
  {minutoiluminacaoligar = 59;
   EEPROM.write(100, minutoiluminacaoligar);
  }
 
}  // End of release event


void b122PopCallback(void *ptr)  // Release event for button 
{
  
  minutoiluminacaodesligar = minutoiluminacaodesligar + 1;
   if(minutoiluminacaodesligar > 59)
  {minutoiluminacaodesligar = 0;
   EEPROM.write(120, minutoiluminacaodesligar);
  }

}  // End of release event


void b123PopCallback(void *ptr)  // Release event for button
{
    minutoiluminacaodesligar = minutoiluminacaodesligar - 1;
    if(minutoiluminacaodesligar < 0)
  {minutoiluminacaodesligar = 59;
   EEPROM.write(120, minutoiluminacaodesligar);
  }
 
}  // End of release event




// botão dual state iluminação 
void bt0PopCallback(void *ptr)  // Release event for dual state button             
{
  uint32_t number5 = 0;  // Create variable to store value we are going to get
  bt0.getValue(&number5);  // Read value of dual state button to know the state (0 or 1)

  if(number5 == 1){  // If dual state button is equal to 1 (meaning is ON)...
    digitalWrite(4, HIGH);  // Turn ON internal LED
  }else{  // Since the dual state button is OFF...
    digitalWrite(4, LOW);  // Turn OFF internal LED
  }
}  // End of release event


// botão dual state bomba circulação 
void bt1PopCallback(void *ptr)  // Release event for dual state button bt      
{
  uint32_t number5 = 0;  // Create variable to store value we are going to get
  bt1.getValue(&number5);  // Read value of dual state button to know the state (0 or 1)

  if(number5 == 1){  // If dual state button is equal to 1 (meaning is ON)...
    digitalWrite(5, HIGH);  // Turn ON internal LED
  }else{  // Since the dual state button is OFF...
    digitalWrite(5, LOW);  // Turn OFF internal LED
  }
}  // End of release event

// botão dual state alimentador
void bt2PopCallback(void *ptr)  // Release event for dual state button bt2     
{
  uint32_t number5 = 0;  // Create variable to store value we are going to get
  bt2.getValue(&number5);  // Read value of dual state button to know the state (0 or 1)

  if(number5 == 1){  // If dual state button is equal to 1 (meaning is ON)...
    digitalWrite(3, HIGH); 
    delay (100);
     digitalWrite(3, LOW);  // Turn OFF internal LED// Turn ON internal LED
  }else{  // Since the dual state button is OFF...
    digitalWrite(3, HIGH); 
    delay (100);
    digitalWrite(3, LOW);  // Turn OFF internal LED
  }
}  // End of release event
virtuabotixRTC   myRTC(clk, dat, rst);         //declara objeto para o RTC


int     temperatura = 0x00,    //valor da variavel de temperatura 
        ph = 0x00,            //valor da variavel de ph 
        bar_ph = 0x00,        // valor da barra de ph
        bar_value = 0x00;    //valor da barra de temperatura

char    txt1[10],
        txt2[10],
        txt3[10],
        txt5[10],
        txt4[10];//texto para conversão e exibição
        
boolean    flag1 = 0x00, 
           flag2 = 0x00;        //armazena o estado do botão
        
// ========================================================================================================

void DS1302();
//void week(int dayW);

// parametros sensor temperatura

const double VCC = 5;             
const double R2 = 10000;            // 10k ohm series resistor
const double adc_resolution = 1023; // 10-bit adc

const double A = 0.001129148;   // thermistor equation parameters
const double B = 0.000234125;
const double C = 0.0000000876741; 

//const double D = 28; //valor de temperatura para disparar o termostato

#define SensorPin A2          //pH meter Analog output to Arduino Analog Input 
unsigned long int avgValue;  //Store the average value of the sensor feedback
float b;
int buf[100],temp;

// parametros sensor de nível
//sensor de nível pino 9

const int buttonPin = 9;    //define pino 9 como input para sensor de nível
int buttonState = 0;


void setup()




{   nexInit(); 


 
   // declaração de ouputs
  pinMode(2,OUTPUT); //saida para ativar termostato
  pinMode(3,OUTPUT);  //saida para ativar alimentador
  pinMode(4,OUTPUT);  //saida para ativar iluminação
  pinMode(5,OUTPUT);  //saida para ativar bomba circulação

 pinMode(10,OUTPUT);  //led teste

  Serial.begin(9600);  


////codigo eeprom////////////////////////////////
  //Limpeza da EEPROM (Executado apenas para limpar a memoria. IMPORTANTE: Apos a primeira carga, comentar este trecho e efetuar a segunda carga em seguida.)
//for (int nL = 0; nL < espacoEEPROM; nL++) { 
 // EEPROM.write(nL, 0);
//}  //Comentar até aqui.




   //  set temp
   b1.attachPop(b1PopCallback);
   b2.attachPop(b2PopCallback);

   // set programador
   b100.attachPop(b100PopCallback);
   b101.attachPop(b101PopCallback);
   b104.attachPop(b104PopCallback);
   b105.attachPop(b105PopCallback);
   b108.attachPop(b108PopCallback);
   b109.attachPop(b109PopCallback);
   b110.attachPop(b110PopCallback);
   b111.attachPop(b111PopCallback);
   b112.attachPop(b112PopCallback);
   b113.attachPop(b113PopCallback);
   b114.attachPop(b114PopCallback);
   b115.attachPop(b115PopCallback);
   b116.attachPop(b116PopCallback);
   b117.attachPop(b117PopCallback);
   b118.attachPop(b118PopCallback);
   b119.attachPop(b119PopCallback);
   b120.attachPop(b120PopCallback);
   b121.attachPop(b121PopCallback);
   b122.attachPop(b122PopCallback);
   b123.attachPop(b123PopCallback);


   
   bt0.attachPop(bt0PopCallback);  // Dual state button bt0 release
   bt1.attachPop(bt1PopCallback);  // Dual state button bt1 release
   bt2.attachPop(bt2PopCallback);  // Dual state button bt2 release

   



    
   // initialize the pushbutton pin as an input: Sensor de nível
   //sensor de nível pino 9
   pinMode(buttonPin, INPUT);
  
   //Faz upload do código para o Arduino uma vez para carregar os
  //dados iniciais no RTC. Após carregar os dados a linha abaixo deve ficar comentada.

 //myRTC.setDS1302Time(segL, minL, horL, d_semL, d_mesL, mesL, anoL);
 // leitura da memoria antes de atualizar para o novo valor obtido pelo botão do nextion  
settemp = EEPROM.read(address1);

//memoria feed
horafeedligar = EEPROM.read(address2);
minutofeedligar = EEPROM.read(address3);

//memoria bomba
horabombaligar = EEPROM.read(address6);
minutobombaligar = EEPROM.read(address7);
horabombadesligar = EEPROM.read(address8);
minutobombadesligar = EEPROM.read(address9);
//memoria iluminação
horailuminacaoligar = EEPROM.read(address10);
minutoiluminacaoligar = EEPROM.read(address11);
horailuminacaodesligar = EEPROM.read(address12);
minutoiluminacaodesligar = EEPROM.read(address13);
   
}//end setup
void loop()
{


 
  
   nexLoop(nex_listen_list);  // Check for any touch event //para botões manuais



  DS1302();  //função de comparação  de timer abaixo

     


   double Vout, Rth, temperature, adc_value; 

  adc_value = analogRead(A0);
  Vout = (adc_value * VCC) / adc_resolution;
  Rth = (VCC * R2 / Vout) - R2;

/*  Steinhart-Hart Thermistor Equation:
 *  Temperature in Kelvin = 1 / (A + B[ln(R)] + C[ln(R)]^3)
 *  where A = 0.001129148, B = 0.000234125 and C = 8.76741*10^-8  */
  temperature = (1 / (A + (B * log(Rth)) + (C * pow((log(Rth)),3))));   // Temperature in kelvin

  temperature = temperature - 273.15;  // Temperature in degree celsius
int temp1 = temperature;
temp_digit.setValue(temp1);
temperatura = temperature; // para a barra
  
ph_val.setText(txt2);
memset(txt2, 0, sizeof(txt2));
itoa(ph, txt2, 10);

//atribuições de variáveis     
//temperatura
d_val.setValue(settemp);


//programador
//feed
horafeedligar_val.setValue(horafeedligar);
minutofeedligar_val.setValue(minutofeedligar);

//bomba
horabombaligar_val.setValue(horabombaligar);
minutobombaligar_val.setValue(minutobombaligar);
horabombadesligar_val.setValue(horabombadesligar);
minutobombadesligar_val.setValue(minutobombadesligar);
//iluminação
horailuminacaoligar_val.setValue(horailuminacaoligar);
minutoiluminacaoligar_val.setValue(minutoiluminacaoligar);
horailuminacaodesligar_val.setValue(horailuminacaodesligar);
minutoiluminacaodesligar_val.setValue(minutoiluminacaodesligar);
  
j0.setValue(bar_value); // informação para barra animada da temperatura
j1.setValue(bar_ph);   // informação para barra animada do ph
bar_value = map(temperatura, 0, 40, 0, 100);
bar_ph = map(ph, 0, 14, 0, 100);
 
  // função de termostato

  
 { if (temperatura <=settemp)
digitalWrite(2, HIGH);
else 
digitalWrite(2, LOW);
   }



//  Envia o texto para o objeto do Nextion

 buttonState = digitalRead(buttonPin);
 if (buttonState == HIGH) {
   
Serial.print("t6.txt=");  // This is sent to the nextion display to set what object name (before the dot) and what atribute (after the dot) are you going to change.
Serial.print("\"");  // Since we are sending text, and not a number, we need to send double quote before and after the actual text.
Serial.print("nivel de agua ok");  // This is the text you want to send to that object and atribute mentioned before.
Serial.print("\"");  // Since we are sending text, and not a number, we need to send double quote before and after the actual text.
Serial.write(0xff);  // We always have to send this three lines after each command sent to the nextion display.
Serial.write(0xff);
Serial.write(0xff);
} 
else 
 {
Serial.print("t6.txt="); 
Serial.print("\""); 
Serial.print("nivel de agua baixo");  
Serial.print("\"");  
Serial.write(0xff); 
Serial.write(0xff);
Serial.write(0xff);}
    
Serial.print("dia.val=");
Serial.print(myRTC.dayofmonth);
Serial.write(0xff);  
Serial.write(0xff);
Serial.write(0xff);

Serial.print("mes.val=");
Serial.print(myRTC.month);
Serial.write(0xff);  
Serial.write(0xff);
Serial.write(0xff);

Serial.print("ano.val=");
Serial.print(myRTC.year);
Serial.write(0xff);  
Serial.write(0xff);
Serial.write(0xff);
    

Serial.print("hour.val=");
Serial.print(myRTC.hours);
Serial.write(0xff);
Serial.write(0xff);
Serial.write(0xff);
    
Serial.print("minute.val=");
Serial.print(myRTC.minutes);
Serial.write(0xff);  
Serial.write(0xff);
Serial.write(0xff);

Serial.print("second.val=");
Serial.print(myRTC.seconds);
Serial.write(0xff);
Serial.write(0xff);
Serial.write(0xff);


 //========================================================================================================================================================================================
 //   Sensor de Ph
    
  for(int i=0;i<10;i++)       //Get 10 sample value from the sensor for smooth the value
  { 
    buf[i]=analogRead(SensorPin);
    delay(10);
  }
  for(int i=0;i<9;i++)        //sort the analog from small to large
  {
    for(int j=i+1;j<10;j++)
    {
      if(buf[i]>buf[j])
      {
        temp=buf[i];
        buf[i]=buf[j];
        buf[j]=temp;
      }
    }
  }
  avgValue=0;
  for(int i=2;i<8;i++)                      //take the average value of 6 center sample
    avgValue+=buf[i];
  float phValue=(float)avgValue*5.0/1024/6; //convert the analog into millivolt
  phValue=3.5*phValue;                      //convert the millivolt into pH value
  delay(50);
  ph = phValue;
}

//=================================================================================================================================
// funções automáticas- comparação dos valores de set com o rtc

void DS1302()
{
  myRTC.updateTime();         //faz leitura do DS1302

int horas = myRTC.hours;
int minutos = myRTC.minutes;
int segundos = myRTC.seconds;
//auto feed 
if (horas==horafeedligar && minutos==minutofeedligar && segundos ==1){
digitalWrite(3, HIGH);}
delay (1000);
digitalWrite(3, LOW);
//auto bomba
if (horas==horabombaligar && minutos==minutobombaligar && segundos ==1){
digitalWrite(5, HIGH);}
if (horas==horabombadesligar && minutos==minutobombadesligar && segundos ==1){
digitalWrite(5, LOW);}
//auto iluminação
if (horas==horailuminacaoligar && minutos==minutoiluminacaoligar && segundos ==1){
digitalWrite(4, HIGH);}
if (horas==horailuminacaodesligar && minutos==minutoiluminacaodesligar && segundos ==1){
digitalWrite(4, LOW);}



} //end DS1302

Hello Fbaptista,
I am replying because you sent me a PM. Unfortunately, as I state in my tutorial, I do not know or use the Nextion libraries, my methods and the sample code I present in the tutorial don't use the libraries and I cannot help you with them, sorry.

++Karma for using code tags properly from your first post.