Only one direction : A4988 Stepper Motor Driver

I am trying to get a stepper motor to go forward and backward but it will only go one way.
I’m using an arduino UNO R3 and as driver a A4988 Stepper Motor Driver Carrier with Voltage Regulators
I’m using a bipolar stepper motor I have tried using a M49SP-2K LF 7.5ºstep and a
STH-39D1126-02 1.8ºstep.

I have two A4988 drivers and both has the same problem.

The way I connected the pins are shown in picture1.
The code I am using is shown in picture2.

All tips and help appreciated.

Thanks.






You are asking the motor to step perhaps too rapidly (presently about 625 steps/sec). Try increasing the 800 usec delays, for example by a factor of 1000, so that you can see what is happening.

What is the motor voltage and current limit? The picture of your setup is poorly focused and nearly useless.

Hello.

It looks like your setup does not match the minimum wiring diagram. There is a red wire that connects VDD from the A4988 stepper motor driver to your Arduino and a yellow wire that connects VDD to the 5V output on the board. Providing power to VDD from two different sources like that can potentially damage things. I suggest removing the red wire, so VDD is only powered by the 5V output on the board. It also looks like you are powering the stepper motor driver from the Arduino. Instead, could you power VMOT on the A4988 board directly with a 8-35V source?

- Jeremy