MotorShield
MotorShield copied to clipboard
Stepper motors don't work with code supplied
I am currently trying to get a stepper motor to work using parts of the sample code from this repo.
import PiMotor
import time
import RPi.GPIO as GPIO
m1 = PiMotor.Stepper("STEPPER1")
# Rotate Stepper 1 Contiously in forward/backward direction
try:
while True:
m1.forward(0.1,180) # Delay and rotations
time.sleep(2)
except KeyboardInterrupt:
GPIO.cleanup()
The motor just goes back and forth by one step. I am using the correct voltage and the correct wiring but nothing seems to fix it.