You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

21 lines
432 B
Python

import time
from motor import PWMMotor
MOTOR_PIN_A = 2
MOTOR_PIN_B = 3
PUMP_ON_TIME = 60
PUMP_SLEEP_TIME = 60 * 9
pump = PWMMotor(MOTOR_PIN_A, MOTOR_PIN_B)
print("Initialized motor. Beginning pump service.")
while True:
print(f"Staring pump for {PUMP_ON_TIME}")
pump.set_speed(1.0)
time.sleep(PUMP_ON_TIME)
print(f"Stopping pump and sleeping. {PUMP_SLEEP_TIME}")
pump.stop()
time.sleep(PUMP_SLEEP_TIME)