if (startCycleTime == 0) {
startCycleTime = currentCycleTime;
if (t>=28, h>=85) {
digitalWrite(AuxFanPin, HIGH);
}
else if (t>=28, h<=85) {
digitalWrite(MainFanPin, HIGH);
digitalWrite(HumidifierPin, HIGH);
}
else if (t<=28, t>=19, h>=85) {
unsigned long currentRefreshTime = millis();
static unsigned long startRefreshTime = 0;
}
else if (t<=28, t>=19, h<=85) {
digitalWrite(AuxFanPin, HIGH);
digitalWrite(HumidifierPin, HIGH);
}
else if (t<=19, h<=85) {
digitalWrite(HeaterPin, HIGH);
digitalWrite(HumidifierPin, HIGH);
digitalWrite(MainFanPin, HIGH);
}
else if (t<=19, h>=85) {
digitalWrite(HeaterPin, HIGH);
digitalWrite(AuxFanPin, HIGH);
}
}
else if (currentCycleTime - startCycleTime > 60000) {
startCycleTime = 0;
}
You are inventing syntax for conditional tests. Please review the Boolean Operators for the logical AND and OR.