sbcshop / MotorShield

Designed to help you get your Raspberry Pi based Robot. This board can control DC motor as well as the stepper motor. You can connect your IR and Ultrasonic sensors to tell your robot about its environment. You can easily make your Line Following, Object following, Wall following, Maze-Solver Robots.
https://shop.sb-components.co.uk/products/motorshield-for-raspberry-pi
52 stars 47 forks source link

Stepper motors don't work with code supplied #27

Open AhhhSaturn opened 2 years ago

AhhhSaturn commented 2 years ago

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.