Create pump_volume.py
This commit is contained in:
parent
3f0e17ade1
commit
19ce5a6f73
21
pump_volume.py
Normal file
21
pump_volume.py
Normal 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)
|
Loading…
Reference in a new issue