Stepper Motors with UCN5860 drivers IC'S and MEGA

hi,I m new in arduino programming and I m trying to rotate stepper motor to 0-90 degree then take brake then rotate reverse 90-0 degree. I m using UCN5860 drivers IC’S and an Arduino Mega 2560.to arduino pins dir=8,Step=6 for the stepper 1

the code is it ,problem occurs in this code that the reverse function couldn’t work…
please advice me and give some help :frowning:

#define Stepper1Step 6
#define Stepper1Direction 8
#define HIGH_TIME_MS 5
#define LOW_TIME_MS 5

void setup()
{
pinMode(Stepper1Step, OUTPUT);
pinMode(Stepper1Direction, OUTPUT);

}

void loop()
{
for(int i = 0; i < 3; i++)
{
stepper1Forward();
applyBrakes();
}
for(int i = 3; i >=1; i–)
{

stepper1Reverse();
}
}

void stepper1Forward()
{
digitalWrite(Stepper1Direction, HIGH);
digitalWrite(Stepper1Step, HIGH);
delay(HIGH_TIME_MS); // 1uS minimum pulse duration for DRV8811
digitalWrite(Stepper1Step, LOW);
delay(LOW_TIME_MS);
}

void applyBrakes()
{
digitalWrite(Stepper1Direction, LOW);
digitalWrite(Stepper1Step, LOW);
delay(600);
}

void stepper1Reverse()
{
digitalWrite(Stepper1Direction, LOW);
digitalWrite(Stepper1Step, HIGH);
delay(HIGH_TIME_MS);
digitalWrite(Stepper1Step, LOW);
delay(LOW_TIME_MS);
}

@alinad, your Post does not seem to have anything to do with the rest of this Thread and I have suggested to the Moderator to move it to its own Thread.

Post a link to the datasheet for the driver you are using. Post a link to the datasheet for your motor.

See stepper motor basics

...R

The UCN-5860 is an ac plasma display driver as far as I can tell from a search.

Link to correct datasheet please.