rotation of stepper motor.

Does stepper motor run continusily. In my case it rotates some rotation and then began to rotate in opposite direction.again after completing a particular rotation it reverses its direction of rotation. I am usning arduino and motor driver for controlling the stepper motor.there is a sensor connected to the A0 pin of arduino. When the sensor value is greater than preset therahold the motor should run continusly in one direction.when the sensor value is less than thershold the motor should rotate in reverse direction continusly. But in my case when the value is above thershold the motor rotates some rotation and it reverses its direction of rotation .similarly when the value is below thershold the motor rotates some rotations and reverse its direction.and this continues... Am using a bipolar stepper motor. Accelero stepper library to control the motor. Please sujest me a solution

A stepper motor will only move one step at a time as long as you tell it to. If it is continuing or changing direction, it is because your program is making it do so.

If this is not what you want, post your code using code tags </>.


As well as posting your code post a link to the datasheets for your stepper motor and for your stepper motor driver.

Stepper Motor Basics
Simple Stepper Code