Create pump_volume.py

This commit is contained in:
tpollina 2019-12-10 14:09:34 -08:00 committed by GitHub
parent 3f0e17ade1
commit 19ce5a6f73
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

21
pump_volume.py Normal file
View file

@ -0,0 +1,21 @@
from adafruit_motor import stepper
from adafruit_motorkit import MotorKit
from time import sleep
kit = MotorKit()
pump = kit.stepper2
pump.release()
def pump_volume(vol):
nb_step=vol*507 #35000steps for 69g with sleep(0.05) in between 2 steps
for i in range(nb_step):
pump.onestep(direction=stepper.FORWARD, style=stepper.DOUBLE)
sleep(0.05)
pump.release()
pump_volume(5)