I want to control two stepper motors via Bluetooth, how to change this code (mas

#include <Stepper.h>

// Set steps per revolution
const int PPR1 = 200;
const int PPR2 = 100;

// Motor Y in pins 2-5
Stepper motor1(PPR1, 2, 3, 4, 5);
// Motor X in pins 6-9
Stepper motor2(PPR2, 6, 7, 8, 9);

void setup() {
  
  }

void loop() {
  // MOTOR 1 CONTROL
  int speed = 0;
  int direction = 1;
  // Get joystick position on A0
  int position = analogRead(0);
  
  /*
  Values between 562 and 1023 mean forward movement. Speed gets
  mapped from 0 to 10 and direction stays positive. Sensors will
  block any movement if HIGH.
  */
  if (position > 562) {
    speed = map(position, 562, 1023, 60, 150);
    direction = 1;
    
  }
  
  /*
  Values between 0 and 462 mean backwards movement. Speed gets
  mapped from 10 to 0 and direction is negative. Sensors will
  block any movement if HIGH.
  */
  if (position < 462 ) {
    speed = map(position, 0, 462, 150, 60 );
    direction = -1;
  }
  // Values between 462 and 562 mean no movement (joystick center zone)
  if (speed > 0) {
    motor1.setSpeed(speed);
    motor1.step(direction);
  }

  // MOTOR 2 CONTROL
  speed = 0;
  direction = 1;
  position = analogRead(1);
 

  if (position > 562) {
    speed = map(position, 562, 1023, 0,  50);
    direction = 1;
  }

  if (position < 462 ) {
    speed = map(position, 0, 462, 50, 0);
    direction = -1;
  }

  if (speed > 0) {
    motor2.setSpeed(speed);
    motor2.step(direction);
  }
}

how to change this code

Fire up a text editor and start typing.

There must be something like 5547851567256 posts on reading serial data, which is what the bluetooth device makes available. Find one or more of them, and study how they do it.

Here's one of the best:

thank you!