Can anyone help me with my StepperMotor, it uses ULN2003 motor drivers and is directly connected from the drivers to my pi. I’ve got a good working script to get the motor to make a 360 degree turn. Here it is:
import RPi.GPIO as GPIO
import time
GPIO.setmode(GPIO.BOARD)
GPIO.setwarnings(False)
control_pins = [40,38,36,32]
for pin in control_pins:
GPIO.setup(pin, GPIO.OUT)
GPIO.output(pin, 0)
halfstep_seq = [
[1,0,0,0],
[1,1,0,0],
[0,1,0,0],
[0,1,1,0],
[0,0,1,0],
[0,0,1,1],
[0,0,0,1],
[1,0,0,1]
]
print "Rotatie Gestart"
for i in range(512):
for halfstep in range(8):
for pin in range(4):
GPIO.output(control_pins[pin], halfstep_seq[halfstep [pin])
time.sleep(0.001)
GPIO.cleanup()
Is there any way for me to just simply call this script in Hassio? I have no idea how to turn this script into a service/action.
Now that I’m still on topic, let me ask another question. What if I had 3 python scripts in the same folder, is it possible to use one of the scripts to call on the other 2? Meaning I import script1 and script2 into script3 and use this in some custom way.