Hi All, I tried connecting the Arduino Mega, a 12V stepper, and Easy Driver and it worked fine for a few minutes. Then after a couple of times of stopping and restarting the code the stepper just kept vibrating. I am wondering if I ended up frying the driver because the code itself is quite straightforward and I was able to make it work earlier. I may have unplugged the power while the stepper was running, later found out that’s not a good idea. I would greatly appreciate some feedback as to what could have gone wrong (Do I need a new driver chip? Stepper got hosed? etc). Also, if the stepper is running, what is a clean way to disconnect so I can stop it and make code changes? Thanks.
Below is the video:
Following is the circuit (I haven’t attached the servos and switch yet):
//Following is the code:
#define DIR_PIN 2 //STEPPER PIN
#define STEP_PIN 3 //STEPPER PIN
void setup() {
pinMode(DIR_PIN, OUTPUT);
pinMode(STEP_PIN, OUTPUT);
}
void loop(){
digitalWrite(DIR_PIN,HIGH);
for(int i=0; i < 100; i++){
digitalWrite(STEP_PIN, HIGH);
delayMicroseconds(500);
digitalWrite(STEP_PIN, LOW);
delayMicroseconds(500);
}
}