two stepper running to same time

Hi there,
Im trying to get two stepper motors to rotate at the same time. when i run the program (shown below) both steppers rotate but NOT AT THE SAME TIME:(. the first one rotates and then the second one rotates. is there a way to mod this program so BOTH STEPPERS RUN AT THE SAME TIME:). ANY HELP would be appreciated. thanks in advance. this is the code that im using (its basically from the samples, just modifies a bit):
CHEERS!!

#include <AccelStepper.h>
#include <MultiStepper.h>

AccelStepper stepper(1, 4, 9);
AccelStepper stepper2(1, 3, 8);

void setup()
{
stepper.setMaxSpeed(2000.0);
stepper.setAcceleration(500.0);
stepper2.setMaxSpeed(2000.0);
stepper2.setAcceleration(500.0);
Serial.begin(9600);

}
float val = 0 ;
float val2 = 0 ;
void loop(){
if (Serial.available() > 0 ) {

val = Serial.parseFloat( );
Serial.print("stepper 1 = ");
Serial.println(val);
stepper.runToNewPosition(val);

val2 = Serial.parseFloat( );
Serial.print("stepper 2 = ");
Serial.println(val2);
stepper2.runToNewPosition(val2);

}
}

stepper.runToNewPosition() is a blocking function. Use stepper.run() for both motors.

Also I think you will need to get both distance values before you start either motor moving. You may find some useful ideas in Serial Input Basics - simple reliable ways to receive data.

...R

float val = 0 ;
float val2 = 0 ;
void loop(){
if (Serial.available() > 0 ) {
   
   val = Serial.parseFloat( );
   Serial.print("stepper 1 = ");
   Serial.println(val);
   stepper.runToNewPosition(val);

Have you ever heard of a stepper that is able to step 3.14159 steps? I haven't, either.

Thank you so much for all your help and feedback, I'm so close to finishing my proto this is all I'm missing.

https://forum.arduino.cc/index.php?topic=93706.0