im trying to add a command to arduino but im not quite sure how to word the code.Here is what i got
- Code: Select all
void runAto()
{ if(digitalRead(ato_input)== LOW){
digitalWrite(ato,HIGH);
lcd.setCursor(4,1);
lcd.print("*");
//digitalWrite(alarm, HIGH);
}
else {
//digitalWrite(alarm, LOW);
digitalWrite(ato, LOW);
lcd.setCursor(4,1);
lcd.print(" ");
}
delay (50);
i want the ato to remain high for 5 seconds as a fail safe if ato input switch gets stuck in on position . this is a water level float switch .when it comes on its usally just for a couple of seconds or just enough water to return to level. but i want the max time for it to be able to run only 5 seconds and never above but i dont want it to always run for 5 seconds either i want it to return the water to level as normal .any help would be appreciated