Here is a portion of my code, I’m using UNO board
As a newbie I hear the DELAY function basically stops/pauses anything else from happening.
So how do I accomplish this another way???
if
(f<=(TEMPPOINT) && digitalRead(PUMP)==ON && digitalRead(INTFANS)==ON && digitalRead(OUTFANS)==ON)
//if cooling unit is on turn off interior fans when I reach 68 wait 2 minutes and then turn off pump and exterior fans
{
digitalWrite(INTFANS,OFF);
delay(120000); // I want to delay the turning off of the PUMP and OUTFANS but keep other things going
digitalWrite(PUMP,OFF);
digitalWrite(OUTFANS,OFF);
delay(120000); // I want to delay the turning off of the PUMP and OUTFANS but keep other things going
Don't just hang around doing nothing. Save the millis() value when you turn the pump and fans on then check each time through loop() whether 120000 has elapsed.