I’m completely new to this and could use some help. I need a stepper motor for a time-lapse slider I’m building.
Stepper Motor: Unipolar/Bipolar, 200 Steps/Rev, 57×76mm, 8.6V, 1 A/Phase
DRV8825 Stepper Motor Driver Carrier, High Current
A-Star 32U4 Prime SV
12v DC Adapter
I basically just followed directions online and looked at picture to set it up… I did set the current limit to 500mv. When I try to program the motor using Arduino software it turns inconsistently and in different directions. Take a look at the picture. Is this even set up properly.
Here is the code
- A stepper motor follows the turns of a potentiometer
- (or other sensor) on analog input 0.
- Stepper - Arduino Reference
- This example code is in the public domain.
// change this to the number of steps on your motor
#define STEPS 100
// create an instance of the stepper class, specifying
// the number of steps of the motor and the pins it’s
// attached to
Stepper stepper(STEPS, 8, 9);
// the previous reading from the analog input
int previous = 0;
// set the speed of the motor to 30 RPMs
// get the sensor value
int val = analogRead(0);
// move a number of steps equal to the change in the
// sensor reading
stepper.step(val - previous);
// remember the previous value of the sensor
previous = val;
Thanks for any tips!