#include <Stepper.h>

const int stepsPerRevolution = 64;  // change this to fit the number of steps per revolution
// for your motor

                                         
// initialize the stepper library for both steppers:
Stepper small_stepper(stepsPerRevolution, 8,10,9,11);  
Stepper small_stepper2(stepsPerRevolution, 4,6,5,7); 

void setup() {

  // set the speed of the motors 
  small_stepper.setSpeed(350);    // set first stepper speed
  small_stepper2.setSpeed(350);   // set second stepper speed
}


void loop() {
 
  int sensorReading = analogRead(A0); // read value from joystick X-axis

  if (sensorReading < 490) { small_stepper.step(1); }   // step left
  if (sensorReading > 540) { small_stepper.step(-1); }  // step right
 
 int sensorReading2 = analogRead(A1); // read value from joystick Y-axis

  if (sensorReading2 < 490) { small_stepper2.step(1); } // step forward
  if (sensorReading2 > 540) { small_stepper2.step(-1); } // step backward
  
 }
