Hi everybody,
I have stepper motor type: 42GBY023-20, 12V, 0.4A, 200 steps, 6 wires and i use arduino mega 2560 with Easy driver, my power for stepper motor is 12V, 0.5A and use laptop for arduino mega.
When i use this code:
#include <Stepper.h>
const int stepsPerRevolution = 200; // change this to fit the number of steps per revolution
// for your motor
// initialize the stepper library on pins 8 through 11:
Stepper myStepper(stepsPerRevolution, 8,9);
void setup() {
// set the speed at 60 rpm:
myStepper.setSpeed(60);
// initialize the serial port:
Serial.begin(9600);
}
void loop() {
// step one revolution in one direction:
Serial.println("clockwise");
myStepper.step(stepsPerRevolution);
delay(500);
// step one revolution in the other direction:
Serial.println("counterclockwise");
myStepper.step(-stepsPerRevolution);
delay(500);
}
my stepper motor not working like this : "// set the speed at 60 rpm:" it's only turning left and turning right at the same position. I try to change other code and change the way to connect wire from motor to easy driver but not working, only vibrate.
I don't know why, please help me !
Thank you all,
Tony.