Accel stepper library with support for 28byj-48 motor issue

Hi kerimil, thanks for the new library. I seem to have a few problems with the library though. I want the stepper motor to move back to its original position after reaching the set position.
I used the code

#include <AccelStepper.h>
AccelStepper stepper3(5, 2, 3, 4, 5);  
void setup()

void loop()
    // Change direction at the limits
        if (stepper3.distanceToGo () == 0)



Unfortunately, it stops after


Moreover, how can I convert the number 1700 to the number of revolutions, as I need exactly 5 revolutions for my project. Thanks, and sorry in advance if some of my questions are stupid…I’m new.

You have re-awakened a 4-years dead Thread.

I have suggested to the Moderator to move your question to its own Thread.