Hardware:
Arduino Mega
Nextion NX4024T032_011 display.
I'm having great difficulty making a code work in one subroutine that works fine in another. I'm trying to use the .getvalue() function of a number box in nextion in arduino. In one, it works perfectly. In another I get an error message which reads "getNumber timeout"
I have been searching here and on the internet for over a week. I can't find any information regarding a getnumber timeout.
The project is a system to contol my pool pump & filter. It will not only schedule the times the pump is on, but inject chlorine, run when pool surface gets above 100 degrees F, shut the system down if pump does not prime within 2 minutes and shut the system off if the pressue rises above 30psi. I don't think anyone wants me to post over 600 lines of code.
The following is the part that works. It simply puts values into the eeprom in case of a power failure. byte1 is a global variable declared as uint32_T. hrs1on/mins1on thru hrs4on/mins4on are number boxes on the nextion display and declared properly in the beginning of the program. I have verified them numerous times.
void btnPumpSchApplyPopCallback(void* ptr) {// Apply button on Pump Schedule page of nextion
//Check boxes to activate/deactivate running a schedule
chk1.getValue(&byte1);
if (byte1 == 1) {
EEPROM.write(29, 1);
chk1.setValue(1);
}
else if (byte1 == 0) {
EEPROM.write(29, 0);
chk1.setValue(0);
}
chk2.getValue(&byte1);
if (byte1 == 1) {
EEPROM.write(30, 1);
chk2.setValue(1);
}
else if (byte1 == 0) {
EEPROM.write(30, 0);
chk2.setValue(0);
}
chk3.getValue(&byte1);
if (byte1 == 1) {
EEPROM.write(31, 1);
chk3.setValue(1);
}
else if (byte1 == 0) {
EEPROM.write(31, 0);
chk3.setValue(0);
}
chk4.getValue(&byte1);
if (byte1 == 1) {
EEPROM.write(32, 1);
chk4.setValue(1);
}
else if (byte1 == 0) {
EEPROM.write(32, 0);
chk4.setValue(0);
}
//Period 1
hrs1on.getValue(&byte1);
EEPROM.write(0, byte1);
mins1on.getValue(&byte1);
EEPROM.write(1, byte1);
hrs1off.getValue(&byte1);
EEPROM.write(2, byte1);
mins1off.getValue(&byte1);
EEPROM.write(3, byte1);
//Period 2
hrs2on.getValue(&byte1);
EEPROM.write(4, byte1);
mins2on.getValue(&byte1);
EEPROM.write(5, byte1);
hrs2off.getValue(&byte1);
EEPROM.write(6, byte1);
mins2off.getValue(&byte1);
EEPROM.write(7, byte1);
//period 3
hrs3on.getValue(&byte1);
EEPROM.write(8, byte1);
mins3on.getValue(&byte1);
EEPROM.write(9, byte1);
hrs3off.getValue(&byte1);
EEPROM.write(10, byte1);
mins3off.getValue(&byte1);
EEPROM.write(11, byte1);
//period 4
hrs4on.getValue(&byte1);
EEPROM.write(12, byte1);
mins4on.getValue(&byte1);
EEPROM.write(13, byte1);
hrs4off.getValue(&byte1);
EEPROM.write(14, byte1);
mins4off.getValue(&byte1);
EEPROM.write(15, byte1);
Eprint();
}
However, this short subroutine does not work and uses the same format as the above code.
void SetTime() {
uint32_t HrSet, MinSet;
Serial.println("Set Time Executed");
StrN1.getValue(&HrSet);
StrN2.getValue(&MinSet);
rtc.adjust(DateTime(2020, 2, 22, HrSet, MinSet, 55));
Serial.println(HrSet);
Serial.println(MinSet);
}
The error code I get when the above routine is called is:
Set Time Executed
getNumber timeout
getNumber timeout
3642860816
66018
Can someone please help me with this?