Stepper motor control with a joystick

Hello people, i am working on a project that involves using stepper motors and easydrivers. So i uploaded some code to make the stepper motor turn when i use the joystick. The upload was fine but when i started testing it, i noticed that the stepper motor did nothing. No sounds no buzzing nothing. idk what it is but i then tried it on 4 other stepper motors and they did not work either. I also noticed from the box that the wires where all messed up (the motors came with the wires) some pictures are attached below. Here is an example:

The wire end the you plug the motor The end where you plug the Arduino
red -------------------------------------------------------------- red
black ------------------------------------------------------------ blue
blue ------------------------------------------------------------- green
green ------------------------------------------------------------ black

pls help as soon as possible.

May thanks, 1024_Bitcoins

Please post your wiring, and how you have powered the easydriver please.

We need code, a data sheet for the stepper, a data sheet for the stepper driver, what Arduino board you are using, what you have for a motor power supply. A schematic and photos of your wiring always help, too. Ideally, we need to have enough information to duplicate your project to be able to provide the best help.

Read the how get the most out of this forum sticky to see how to properly post code and advice on how to get the most from the forum. Remove useless white space and format the code with the IDE autoformat tool (crtl-t or Tools, Auto Format) before posting code in code tags. If the code is too large to post it can be attached.

missdrew:
Please post your wiring, and how you have powered the easydriver please.

i am using a DC power supply from wanptek i put it at 9 volts which is what i used before and it worked and the wiring is

groundFungus:
We need code, a data sheet for the stepper, a data sheet for the stepper driver, what Arduino board you are using, what you have for a motor power supply. A schematic and photos of your wiring always help, too. Ideally, we need to have enough information to duplicate your project to be able to provide the best help.

The code

#define step_pin 3
#define dir_pin 2 
#define MS1 5 
#define MS2 4 
#define SLEEP 7 
#define X_pin A0 
 
int direction; 
int steps = 1025; 
 
void setup () {
   pinMode (MS1, OUTPUT);
   pinMode (MS2, OUTPUT);
   pinMode (dir_pin, OUTPUT);
   pinMode (step_pin, OUTPUT);
   pinMode (SLEEP, OUTPUT);
   
   digitalWrite (SLEEP, HIGH);
   delay (1); 
   

 
   digitalWrite (MS1, LOW); 
   digitalWrite (MS2, LOW); 
   
}
 
void loop () {
  while (analogRead (X_pin) >= 0 && analogRead (X_pin) <= 100) {
    if (steps> 0) {
      digitalWrite (dir_pin, HIGH); 
      digitalWrite (step_pin, HIGH);
      delay (1);
      digitalWrite (step_pin, LOW);
      delay (1);
      steps--;
    }
  }
  
    while (analogRead (X_pin)> 100 && analogRead (X_pin) <= 400) {
      if (steps <512) {
        digitalWrite (dir_pin, LOW); 
        digitalWrite (step_pin, HIGH);
        delay (1);
         digitalWrite (step_pin, LOW);
        delay (1);
        steps ++;
      }
      if (steps> 512) {
        digitalWrite (dir_pin, HIGH);
        digitalWrite (step_pin, HIGH);
        delay (1);
         digitalWrite (step_pin, LOW);
        delay (1);
        steps--;
      }
    }
      
    while (analogRead (X_pin)> 401 && analogRead (X_pin) <= 600) {
      if (steps <1025) {
        digitalWrite (dir_pin, LOW);
        digitalWrite (step_pin, HIGH);
        delay (1);
         digitalWrite (step_pin, LOW);
        delay (1);
        steps ++;
      }
      if (steps> 1025) {
        digitalWrite (dir_pin, HIGH);
        digitalWrite (step_pin, HIGH);
        delay (1);
         digitalWrite (step_pin, LOW);
        delay (1);
        steps--;
      }
    }
 
    while (analogRead (X_pin)> 601 && analogRead (X_pin) <= 900) {
      if (steps <1535) {
        digitalWrite (dir_pin, LOW);
        digitalWrite (step_pin, HIGH);
        delay (1);
         digitalWrite (step_pin, LOW);
        delay (1);
        steps ++;
      }
      if (steps> 1535) {
        digitalWrite (dir_pin, HIGH);
        digitalWrite (step_pin, HIGH);
        delay (1);
         digitalWrite (step_pin, LOW);
        delay (1);
        steps--;
      }
    }
   
    while (analogRead (X_pin)> 900 && analogRead (X_pin) <= 1024) {
      if (steps <2050) {
        digitalWrite (dir_pin, LOW);
        digitalWrite (step_pin, HIGH);
        delay (1);
         digitalWrite (step_pin, LOW);
        delay (1);
        steps ++;
      }
    }
}

and what are data sheets? and i am using a arduino uno