def priming(self, valves_in_use_feeding): # Open all valves for valve in valves_in_use_feeding: Context.control_box.open_valve(valve) # prime water In for _ in range(1): Context.check_water_sensor() Context.run_pump(Context.water_in, duration=0.5) # prime water Out for _ in range(1): Context.check_water_sensor() Context.run_pump(Context.water_out1, duration=3) Context.control_box.close_valve(valve) # # Close all valves # for valve in valves_in_use: # Context.control_box.close_valve(valve) lprint("pumps primed")
def stream(self): # stream water to fish tanks for i in range(2): Context.check_water_sensor() Context.run_pump(Context.water_out1, duration=1) # bring water and stream fishfeeder for _ in range(1): Context.check_water_sensor() Context.control_box.set_pwm(Context.water_in, 255) Context.control_box.set_pwm(Context.water_out1, 255) sleep(0.5) Context.control_box.set_pwm(Context.water_in, 0) Context.control_box.set_pwm(Context.water_out1, 0) Context.run_pump(Context.water_out1, duration=1) #for _ in range(1): #Context.check_water_sensor() #Context.run_pump(Context.water_in, duration=1) #for _ in range(1): #Context.check_water_sensor() #Context.run_pump(Context.water_out1, duration=2) lprint("food water mix streamed")
def clean(self): for _ in range(1): # bring clean water to fishfeeder Context.check_water_sensor() Context.run_pump(Context.water_in, duration=0.25) # thrash water from fishfeeder Context.check_water_sensor() Context.run_pump(Context.water_out1, duration=2) for _ in range(1): for _ in range(1): # bring clean water to fishfeeder Context.check_water_sensor() Context.run_pump(Context.water_in, duration=0.25) for _ in range(1): # thrash water from fishfeeder Context.check_water_sensor() Context.run_pump(Context.water_out1, duration=1) for _ in range(1): # bring clean water to fishfeeder Context.check_water_sensor() Context.run_pump(Context.water_in, duration=2) for _ in range(1): # thrash water from fishfeeder Context.check_water_sensor() Context.run_pump(Context.water_out1, duration=20) Context.STATUS = "Cleaned" lprint("tanks cleaned")