Create recover.py

This commit is contained in:
tpollina 2019-12-13 12:39:16 -08:00 committed by GitHub
parent 760bb101f9
commit 99f1d7bb9f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

22
scripts/recover.py Normal file
View file

@ -0,0 +1,22 @@
#!/usr/bin/env python
#recover the hardware after a brutal killing
from adafruit_motor import stepper
from adafruit_motorkit import MotorKit
from time import sleep
import RPi.GPIO as GPIO
kit = MotorKit()
stage = kit.stepper1
pump_stepper = kit.stepper2
#release the steppers after killing
stage.release()
pump_stepper.release()
#turn off LED after killing
GPIO.setmode(GPIO.BCM)
GPIO.setwarnings(False)
GPIO.setup(21,GPIO.OUT)
GPIO.output(21,GPIO.LOW)