I’ve got a simple system, which is initiate with a pushbutton: A spring engages, it then turns off while a Vacuum simultaneously turns on, and a counter adds 1 to its count.
What i’m trying to do is push the button, let the cycle run one time and then halt until the button is pushed again. It runs fine for the first cycle but will not run if the button is pushed a second time.
//Pin 8 is Relay 0, Pin 7 is Relay 1, Pin 9 is Button Pin
int Button = 9;
int Spring = 8;
int Vac = 7;
int ButtonState = 0;
ButtonState = digitalRead(Button);
if ((ButtonState == HIGH) && (Counter < 1))