Hi all,
I see the following weird thing:
If I use a boolean to be set as last action inside an IF statement, it will not be set, but when I put something behind it, like in my example the NightRunActiveIndicator = true; it WILL work?!?
The variables are all declared in the portion of the code before setup() and loop(), but after some #includes .
This is just a very small part of the code used inside loop()
So like this it will work, NightRunActiveIndicator WILL be set:
// Begin of Check if we need to start the Nightly Run
if ( ( NightStartTime != 0 ) && ( millis() > NightStartTime) && ( AccDone == true ) ) {
AccDone = false;
Load = ( MaxLoad - FireAdjustHigh) ;
NightRunActive = true;
NightRunActiveIndicator = true;
lcd.setCursor(0, 1);
lcd.print("Nightly Run!! ");
lcd.write(1);
}
// End of Check if we need to start the Nightly Run
And like this it will NOT work, NightRunActiveIndicator will NOT be set:
// Begin of Check if we need to start the Nightly Run
if ( ( NightStartTime != 0 ) && ( millis() > NightStartTime) && ( AccDone == true ) ) {
AccDone = false;
Load = ( MaxLoad - FireAdjustHigh) ;
lcd.setCursor(0, 1);
lcd.print("Nightly Run!! ");
lcd.write(1);
NightRunActive = true;
NightRunActiveIndicator = true;
}
// End of Check if we need to start the Nightly Run
So changing the order of these 5 lines of code makes all the difference?
I use an Arduino Pro Mini and Arduino IDE 1.8.13
Is this a known issue or do I something wrong in my code?
Saludos,
Leo