I'm using 2 x 1.8-Degree Nema 14, 35 BYGHW Stepper Motors with a DRV8825 Stepper Motor.
I have tried all 24 combinations of wiring the damn 4 wires but it won't work. I am using a 9v battery as the motor power source, which is fine.
It sometimes turns when I have 3 wires connected??
I can guarantee the wiring is correct, and this is the sketch.
Here is the code, which I am almost certain is correct too, I just started this project and I can't even get a damn motor to work!
/* stepper motor control code for DRV8825
*
*/
// define pin used
const int stepPin = 9;
const int dirPin = 8;
void setup() {
// set the two pins as outputs
pinMode(stepPin,OUTPUT);
pinMode(dirPin,OUTPUT);
}
void loop() {
digitalWrite(dirPin,HIGH); //Enables the motor to move in a perticular direction
// for one full rotation required 200 pulses
for(int x = 0; x < 200; x++){
digitalWrite(stepPin,HIGH);
delayMicroseconds(500);
digitalWrite(stepPin,LOW);
delayMicroseconds(500);
}
delay(1000); // delay for one second
digitalWrite(dirPin,HIGH); //Enables the motor to move in a opposite direction
// for three full rotation required 600 pulses
for(int x = 0; x < 600; x++){
digitalWrite(stepPin,HIGH);
delayMicroseconds(500);
digitalWrite(stepPin,LOW);
delayMicroseconds(500);
}
delay(1000); // delay for one second
}