Hi all,
I am wondering if you experienced eyes could take a look at what I'm doing and help me identify my problem. I bought this set of products with the intent of controlling 4 stepper motors in tandem for a personal project: https://www.amazon.com/gp/product/B07JV835SW/ref=ppx_yo_dt_b_asin_title_o00_s00?ie=UTF8&th=1
I am trying to get a motor spinning, but all it does is vibrate. The code I'm using is shown below.
const int stepPin = 60;
const int dirPin = 61;
const int enablePin = 56;
void setup() {
pinMode(stepPin,OUTPUT);
pinMode(dirPin,OUTPUT);
pinMode(enablePin,OUTPUT);
digitalWrite(enablePin,LOW);
digitalWrite(dirPin,HIGH);
for(int x = 0; x < 200; x++) {
digitalWrite(stepPin,HIGH);
delayMicroseconds(500);
digitalWrite(stepPin,LOW);
delayMicroseconds(500);
}
delay(1000); // One second delay
digitalWrite(dirPin,LOW); //Changes the rotations direction
for(int x = 0; x < 400; x++) {
digitalWrite(stepPin,HIGH);
delayMicroseconds(500);
digitalWrite(stepPin,LOW);
delayMicroseconds(500);
}
delay(1000);
}
void loop() {
}
So far I have tried playing with motor wire positions and tried it on a different computer. The wiring of the RAMPS board is shown in the link here: Imgur: The magic of the Internet. Does anyone see any errors that I have missed? If not, what are the recommended troubleshooting steps from this point?
Thanks!
Eric