I just bought a NEMA 17 motor and some DRV2285 drivers and am following this tutorial.
Originally, the problem was that the stepper motors weren't turning, only vibrating. I was able to adjust the voltage using a multimeter. Now, all my voltage values are reading zero from the motor driver. I verified that my multimeter wasn't the culprit by checking my 12 V, 2 A power supply that I'm using to power my driver. Now, the stepper motor won't turn too. How do I get my stepper motor working? Any help would be appreciated.
Here is the code I am using:
// Include the AccelStepper Library
#include <AccelStepper.h>
// Define pin connections
const int dirPin = 5;
const int stepPin = 4;
// Define motor interface type
#define motorInterfaceType 1
// Creates an instance
AccelStepper myStepper(motorInterfaceType, stepPin, dirPin);
void setup() {
// set the maximum speed, acceleration factor,
// initial speed and the target position
myStepper.setMaxSpeed(1000);
myStepper.setAcceleration(50);
myStepper.setSpeed(200);
myStepper.moveTo(200);
}
void loop() {
// Change direction once the motor reaches target position
if (myStepper.distanceToGo() == 0)
myStepper.moveTo(-myStepper.currentPosition());
// Move the motor one step
myStepper.run();
}
I am using the wiring shown in the article I linked above, except my DIR pin is in pin 5, and my STEP pin is in pin 4 because pins two and three are being used: