So Im having trouble trying to figure this out. My project needs a valve to stay shut and when an event is triggered, 3 seconds into that event the valve opens for 2 seconds, then remain shut till it's triggered again. I was just treating it like an LED in the code. I was trying to code it to jump from one if-statement to the next with the appropriate delays but it doesn't work the way i thought it would. Any help would be great. Thanks
//the event does ventGo0 = true;
if(((millis() - previousVenting) > offoffDuration)&&(ventGo0==true)){
previousVenting1 = millis();
ventGo1=true;
ventGo0=false;
}
if(((millis() - previousVenting1) > onDuration)&&(ventGo1==true)){
digitalWrite(ventPin, HIGH);
previousVenting2 = millis();
ventGo2=true;
ventGo1=false;
}
if(((millis() - previousVenting2) > offDuration)&&(ventGo2==true)){
digitalWrite(ventPin, LOW);
ventGo2=false;
}
```
if (ventGo1==true)
is same asif (ventGo1)