Hello Robin2
Thanks for the input. But if I'm understanding your code correct then you've programmed a low, medium and high setpoint. Where digital output 2 switches on at the medium setpoint and digital output 3 switches on at the high setpoint. I need it to alternate between the two outputs. Maybe I didn't understand your code correct but if I did, then this is just a limit switch configuration and not an alternating switch configuration
Anyways, I got it working using my existing code. I had to implement a second validating variable since the Alternating_Trigger variable was going from value 1 to value 2 back to value 1 because of the way the if statements were setup. I've attached it and reworked it a bit for you to go through if your interested. Thanks again for taking the time to go through my query.
Dirk
Alternating_Pump_Control.ino (11 KB)