MotorShield icon indicating copy to clipboard operation
MotorShield copied to clipboard

Stepper motors don't work with code supplied

Open AhhhSaturn opened this issue 3 years ago • 0 comments

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.

AhhhSaturn avatar Mar 04 '22 14:03 AhhhSaturn