Stepper Motor HELP!!!!

My team and I have been working on senior projects and are working with bipolar stepper motors with the Arduino UNO R3 Plus and Dual Step Motor Driver Shield.  We've been trying to get this code we found in the stepper library to move the motor forwards and backwards but for some reason when we write the stepper.step() as a negative value it continues to move forwards and also increases the speed.  Any help is appreciated...

/*

#include <Stepper.h>

// change this to the number of steps on your motor
#define STEPS 200

// create an instance of the stepper class, specifying
// the number of steps of the motor and the pins it’s
// attached to
Stepper x_stepper(STEPS, 2, 3, 4, 5);

// the previous reading from the analog input
//int previous = 0;

void setup()
{
// set the speed of the motor to 30 RPMs
x_stepper.setSpeed(200);
}

void loop()
{
// get the sensor value
// int val = analogRead(0);

// move a number of steps equal to the change in the
// sensor reading
x_stepper.step(-800);
//delay(500);
// x_stepper.step(-500);
//delay(500);

// remember the previous value of the sensor
//previous = val;
}

Your post is backwards. The code goes in the code box. The question/description does not.

Like this:

Student53:
My team and I have been working on senior projects and are working with bipolar stepper motors with the Arduino UNO R3 Plus and Dual Step Motor Driver Shield. We’ve been trying to get this code we found in the stepper library to move the motor forwards and backwards but for some reason when we write the stepper.step() as a negative value it continues to move forwards and also increases the speed. Any help is appreciated…

/*

#include <Stepper.h>

// change this to the number of steps on your motor
#define STEPS 200

// create an instance of the stepper class, specifying
// the number of steps of the motor and the pins it’s
// attached to
Stepper x_stepper(STEPS, 2, 3, 4, 5);

// the previous reading from the analog input
//int previous = 0;

void setup()
{
  // set the speed of the motor to 30 RPMs
  x_stepper.setSpeed(200);
}

void loop()
{
  // get the sensor value
// int val = analogRead(0);

// move a number of steps equal to the change in the
  // sensor reading
  x_stepper.step(-800);
  //delay(500);
// x_stepper.step(-500);
  //delay(500);

// remember the previous value of the sensor
//previous = val;
}

Your driver board is a “Step and Direction” driver. You should pass only the Step and Direction pins when you create the Stepper object:

Stepper x_stepper(STEPS, 2, 3,);
Stepper y_stepper(STEPS, 6, 7,);

The MS1 and MS2 inputs on the driver control the microstepping and are not something the library mucks with. Set them to outputs and set those outputs to indicate the degree of microstepping you want.