that could help diagnose the issue? The code I’ve written is below (all of the print statements are executing):
Code: Select all
from time import sleep
import RPi.GPIO as GPIO
DIR = 24
STEP = 25
CW = 1
CCW = 0
SPR = 200 # steps per revolution: 360 / 1.8
def main():
print("DIR = " + str(DIR))
print("STEP = " + str(STEP))
GPIO.setmode(GPIO.BCM)
GPIO.setup(DIR, GPIO.OUT)
GPIO.setup(STEP, GPIO.OUT)
GPIO.output(DIR, CW)
step_count = SPR # 1 full rotation
delay = 0.0208
for i in range(step_count):
GPIO.output(STEP, GPIO.HIGH)
sleep(delay)
GPIO.output(STEP, GPIO.LOW)
sleep(delay)
print("done")
GPIO.cleanup()
if _name_ == "__main__":
main()
I have attached a diagram of how I have wired my Raspberry Pi to my driver along with some photos of my soldering connections.
Interestingly, I disconnected the Raspberry Pi from power and the motor sounded like it was moving until I powered up the RPi again. Did I possibly blow the motor?