Multistepper not working

I don't know what's going on, I'm using a microstep driver, using 2 pins for direction and steps in the stepper motors for the XY machine, but nothing seems to be working.

What's wrong?

Here is the code:

coconut_processing.ino (7.1 KB)

Edit: Here's a more cleaner code sample:

//For XYZ positioning
byte XdirPin = 46;
byte XstepPin = 48;
byte YdirPin = 50;
byte YstepPin = 52;
//For Multistep
AccelStepper stp1(AccelStepper::DRIVER, XstepPin, XdirPin );
AccelStepper stp2(AccelStepper::DRIVER, YstepPin, YdirPin);
MultiStepper mulstp;

void setup() {

  Serial.begin(9600);
  Serial.println("Starting XY Positioning System...");
  
  delay(1000);
//Setup for all motor pins
  pinMode(XdirPin, OUTPUT);
  pinMode(XstepPin, OUTPUT);
  pinMode(YdirPin, OUTPUT);
  pinMode(YstepPin, OUTPUT);

//Setup for Multistepper
// Configure each stepper for speed
  stp1.setMaxSpeed(25000);
  stp2.setMaxSpeed(25000);
// Send steppers to multistepper
  mulstp.addStepper(stp1);
  mulstp.addStepper(stp2);
}

void loop() {

 long pos[2];
 pos[0]=10;
 pos[1]=10;
 mulstp.moveTo(pos);
 mulstp.runSpeedToPosition();
 delay(500);
 while(true) { 
  
  }//end function
}

Have you written a short program that just makes one motor move and tested it with each motor separately?

If not then you could try this Simple Stepper Code

Also, always start all tests with very slow stepper speeds. The multistepper library does not use acceleration.

...R
Stepper Motor Basics

Well, each motor works in itself after I used the both pins separately.

Still have no idea as to why the program didn't work.

And yes, I have my own test code, and both motors work.

it_master:
Well, each motor works in itself after I used the both pins separately.

Please expand on that and post the relevant program.

...R