Can't Get My Motor and Driver Set Up Again

I bought a couple of A4983

replacement boards and hooked one up to my 1205

motor. I had this running quite well a few months ago when I last had it all set up. I can’t get it to run right. I don’t know what I have done wrong.

The motor runs smoothly but slowly and it won’t stop. I tried different sets of code and get the same results. I set the for loop to only run 10 steps. I added different delays but they are ignored. I thought that the Arduino wasn’t getting updated so I took out the code void loop except for one integer. The motor reacted by not running and locking up like I thought that it would. When I put the write code back in, it runs as before.

What can I do to fix this?

This is one of the sets of code that I used.

    #define stepPin 42
    #define dirPin 44
    #define enablePin 46

    void setup()
    {
      // We set the enable pin to be an output
      pinMode(enablePin, OUTPUT);
      // then we set it HIGH so that the board is disabled until we
      // get into a known state.
      digitalWrite(enablePin, HIGH);
      Serial.begin(9600);
      Serial.println("Starting stepper exerciser.");
      pinMode(stepPin, OUTPUT);
      pinMode(dirPin, OUTPUT);
    }

    void loop()
    {
    int j;
    digitalWrite(enablePin, LOW);
    delayMicroseconds(2);
    digitalWrite(dirPin, HIGH);

    for(j=0; j<=10; j++)
      {
       digitalWrite(stepPin, LOW);
       delayMicroseconds(2);
       digitalWrite(stepPin, HIGH);
       delayMicroseconds(1000);
       Serial.println(j);
      }
      digitalWrite(enablePin, HIGH);
      delayMicroseconds(10000);
      //delay(3000);
      //while(j==10000)
      Serial.println(j);
      Serial.println("Loop");
 }

You only have 10 milliseconds of delay (delayMicroseconds(10000):wink: between each of your loops of 10 steps.

What are your Serial.prints showing?

Thank you for responding. I tried different time periods and posted the wrong one.

I believe that I found the problem. I think that I have a problem with my pin 44 on the Arduino. When I move the three pin connector from 42, 44 and 46 to 32, 34, and 36, it runs just like before. It also works 43, 45 and 47.

Thanks again.