Need help with my problem in project

Hello family :), today I found a problem in my project, here is the video of the problem
https://streamable.com/wamm9

When I choose yes to turn a motor it works well but the other motors that is after does not work.
I want the other motors turn if I choose yes even if the previous motor is running.
Please, I need your help because my project is blocked.

MASTER CODE

#include <Wire.h>

const int BUTTON1=5;
const int BUTTON2=6;
int buttonchoose;

void setup() {
  // put your setup code here, to run once:
 pinMode(BUTTON1,INPUT);
 pinMode(BUTTON2,INPUT);
 Wire.begin();
 Serial.begin(9600);
}

void loop() {
  Serial.println("You want turn X motor");
  Serial.println("1-YES  2-NO");
  buttonchoose=fonctioninput();
  delay(500);
  if(buttonchoose==1){
    //Turn motor x for onerevolution
  Wire.beginTransmission(8); // transmit to device #8
  Wire.write('X'); // send M (milk)
  Wire.endTransmission();    // stop transmitting
  Serial.println("send X");
  
  }
  Serial.println("You want turn Y motor");
  Serial.println("1-YES  2-NO");
  buttonchoose=fonctioninput();
  delay(500);
  if(buttonchoose==1){
    //Turn motor Y for onerevolution
    Wire.beginTransmission(8); // transmit to device #8
  Wire.write('Y'); // send M (milk)
  Wire.endTransmission();    // stop transmitting
  Serial.println("send Y");
  
  }
  
  Serial.println("You want turn Z motor");
  Serial.println("1-YES  2-NO");
  buttonchoose=fonctioninput();
  delay(500);
  if(buttonchoose==1){
    //Turn motor Z for onerevolution
  Wire.beginTransmission(8); // transmit to device #8
  Wire.write('Z'); // send M (milk)
  Wire.endTransmission();    // stop transmitting
  Serial.println("send Z");
  }
}


int fonctioninput(){
  int val1 =0;
  int val2 =0;
  int buttonreturn=0;
  while( (val1 - val2) == 0){
  val1=digitalRead(BUTTON1);
  val2=digitalRead(BUTTON2);
 }
 
if(val1 == 1){
  buttonreturn=1;
}
else {
  buttonreturn=2;
}
return buttonreturn;
}

SLAVE CODE

#include <Wire.h>
#include <Stepper.h>

const int stepsPerRevolution = 64;
int led=A0;
Stepper motorX(stepsPerRevolution, 2, 3, 4, 5);
Stepper motorY(stepsPerRevolution, 6, 7, 8, 9);
Stepper motorZ(stepsPerRevolution, 10, 11, 12, 13);

void setup() {
  
  Wire.begin(8);
// Wire.onRequest(requestEvent);
 Wire.onReceive(receiveEvent);
  
  pinMode(led,OUTPUT);
  motorX.setSpeed(60);
  motorY.setSpeed(60);
  motorZ.setSpeed(60);
  Serial.begin(9600);
  

}


void loop() { 
   
}

void receiveEvent(int howMany) {
 
  char choose;
 
while(Wire.available() > 0) {
  //initialization
   choose='A';
   choose = Wire.read(); 
   
    if (choose == 'X')    {
      Serial.println("TURN MOTOR X");
      
       turnX();       
  }
  
 else if (choose == 'Y') {
  Serial.println("TURN MOTOR Y");
     turnY();
  }
  else if (choose == 'Z') {
   Serial.println("TURN MOTOR Z");
     turnZ();
     
      }
    
   }
  analogWrite(led,1020);
  delay(300);
  analogWrite(led,0);
  
}

void turnX(){
  motorX.step(stepsPerRevolution);
  
}
void turnY(){
  motorY.step(stepsPerRevolution);
  
}

void turnZ(){
  motorZ.step(stepsPerRevolution);
  
}

I want help N O W ! !

Also posted at:

If you're going to do that then at least be considerate enough to add links to the other places you cross posted. This will let us avoid wasting time due to duplicate effort and also help others who have the same questions and find your post to discover all the relevant information.

What is it with people who can't write a decent problem statement? If the engineers that work for me wrote like that, they wouldn't be working for me very long.

pert:
Also posted at:
arduino uno - Need help with my urgent problem - Arduino Stack Exchange

It should come as no surprise to learn that this is also crossposted in the French forum.

Pete

Delta_G:
You probably have an issue in your code somewhere. How you expect us to find it is beyond me since you didn't post the code. If this is so urgent then why waste time making us ask for it. It doesn't take some great leap of intelligence to figure out that someone can't debug what they can't see. You should probably also give a few details about what we're looking at in that image.

BTW: You'll find that posts asking for urgent help, like you think you should skip to the front of the line, typically get met with slower responses from the community. Just an observation.

I have add the code

pert:
Also posted at:
arduino uno - Need help with my urgent problem - Arduino Stack Exchange
If you're going to do that then at least be considerate enough to add links to the other places you cross posted. This will let us avoid wasting time due to duplicate effort and also help others who have the same questions and find your post to discover all the relevant information.

I put my problem in other forum just to get a solution , If no one sees the subject here

gfvalvo:
What is it with people who can't write a decent problem statement? If the engineers that work for me wrote like that, they wouldn't be working for me very long.

I am just a student

aymannox:
I put my problem in other forum just to get a solution , If no one sees the subject here

I didn't say you can't do that, I just asked that you add links in the future. It only takes a tiny bit more of your time and it can save much more of the time of the people trying to help you and also make it more likely that you will get help.

Delta_G:
No, you added links to another site where the code is. Most folks here aren't going to follow you offsite to get your code. We're volunteers here helping for FREE. Making it harder to help you is usually going to result in no help, especially when you're one of those URGENT people.

Please read the forum stickies and the forum rules "How To Use This Forum" at the top of any board. There you will learn how to do these things right. If my need was really that urgent, I would have done that first to avoid wasting time learning it the hard way like this.

I have put the code directly

Hi,
You need to look at AccelStepper library, it has a multi stepper example.

Tom... :slight_smile: