Stepper not going in reverse

Hi! I am doing a project in whitch I need to control 2 steppers from distance but when I tried to program them to go in reverse it does not work. they go in the same direction. when I try to set the current position as 0 and then make it go reverse, it still goes forward. I will attach the code here. You may see some things that may seem a bit out place, like some comments from some of my experiments, but I am open to any suggestion. It is a 28BYJ-48 stepper. If it helps to look at it better, the reverse command is supposed to be 3. My code may have some other issues to, but now this one is the biggest

#include <AccelStepper.h>
#include <LiquidCrystal_I2C.h>
#include <Wire.h>

// Pini pentru motorul 1
#define motor1Pin1 2
#define motor1Pin2 3
#define motor1Pin3 4
#define motor1Pin4 13

// Pini pentru motorul 2
#define motor2Pin1 8
#define motor2Pin2 9
#define motor2Pin3 10
#define motor2Pin4 11

#define bluetoothTx 1
#define bluetoothRx 0

// Definirea adresei I2C pentru LCD QAPASS
#define LCD_ADDRESS 0x27
#define LCD_COLUMNS 16
#define LCD_ROWS 2

LiquidCrystal_I2C lcd(LCD_ADDRESS, LCD_COLUMNS, LCD_ROWS);

int x=1;

// Pini pentru modulul Bluetooth HC-05
#define bluetoothEn 6    // Pinul EN al modulului Bluetooth
#define bluetoothState 7 // Pinul STATE al modulului Bluetooth

AccelStepper motor1(AccelStepper::FULL4WIRE, motor1Pin1, motor1Pin2, motor1Pin3, motor1Pin4);
AccelStepper motor2(AccelStepper::FULL4WIRE, motor2Pin1, motor2Pin2, motor2Pin3, motor2Pin4);

#define MAX_COMMAND_LENGTH 10 // Ajustează dimensiunea maximă a comenzilor
char receivedCommand[MAX_COMMAND_LENGTH];
int commandIndex = 0;

void setup() {

lcd.setBacklight(LOW);  // Setează retroiluminarea la nivel scăzut (LOW) pentru a o opri
  delay(1000);            // Așteaptă o secundă pentru a permite stabilizarea
  lcd.setBacklight(HIGH);

  Serial.begin(9600);
  pinMode(bluetoothEn, INPUT);
  pinMode(bluetoothState, OUTPUT);

   Wire.begin();
  lcd.begin(LCD_COLUMNS, LCD_ROWS, LCD_5x8DOTS);
  lcd.print("Bun venit!");

// Afișează informații suplimentare pe LCD, dacă este cazul
lcd.setCursor(0, 1);
lcd.print("Proiect Arduino");

  motor1.setMaxSpeed(1000);
  motor1.setAcceleration(100);
  motor2.setMaxSpeed(1000);
  motor2.setAcceleration(100);

  // Inițializează modulul Bluetooth
  digitalWrite(bluetoothEn, HIGH); // Activează modulul Bluetooth

  // Inițializează modulul Bluetooth HC-05
  delay(500); // Așteaptă 500 de milisecunde pentru a permite stabilizarea modulului

  // Pini pentru motorul 1
  pinMode(motor1Pin1, OUTPUT);
  pinMode(motor1Pin2, OUTPUT);
  pinMode(motor1Pin3, OUTPUT);
  pinMode(motor1Pin4, OUTPUT);

  // Pini pentru motorul 2
  pinMode(motor2Pin1, OUTPUT);
  pinMode(motor2Pin2, OUTPUT);
  pinMode(motor2Pin3, OUTPUT);
  pinMode(motor2Pin4, OUTPUT);

  // Dezactivează motoarele inițial
  digitalWrite(motor1Pin1, LOW);
  digitalWrite(motor1Pin2, LOW);
  digitalWrite(motor1Pin3, LOW);
  digitalWrite(motor1Pin4, LOW);
  digitalWrite(motor2Pin1, LOW);
  digitalWrite(motor2Pin2, LOW);
  digitalWrite(motor2Pin3, LOW);
  digitalWrite(motor2Pin4, LOW);
}

void loop() {
  updateBluetooth();

  while (Serial.available() > 0) {
    char receivedChar = Serial.read();

    if (receivedChar == '\n') {
      // S-a primit o comandă completă, procesează șirul de caractere acumulat
      receivedCommand[commandIndex] = '\0'; // Adaugă terminatorul de șir
      processBluetoothCommand(receivedCommand);
      commandIndex = 0; // Resetează indexul pentru următoarea comandă
    } else {
      // Ignoră caracterele de revenire la linie
      if (receivedChar != '\r') {
        // Adaugă caracterul la șirul de caractere acumulat
        receivedCommand[commandIndex++] = receivedChar;

        // Verifică depășirea dimensiunii maxime a comenzii
        if (commandIndex >= MAX_COMMAND_LENGTH) {
          commandIndex = 0; // Resetează indexul în caz de depășire
        }
      }
    }
  }
}

void moveMotorToPosition(AccelStepper &motor, long targetPosition) {
  motor.moveTo(targetPosition);
  motor.runToPosition();
}


void processBluetoothCommand(char* command) {
  Serial.println("Comanda primita: " + String(command)); // Afișează comanda primită


// Afișează comanda și pe LCD
  lcd.clear();
  lcd.setCursor(0, 0);
  lcd.print("Comanda: ");
  lcd.setCursor(0, 1);
  lcd.print(command);



  // Procesează comanda aici
  if (strcmp(command, "1") == 0) {
    motor1.setSpeed(500);
    motor1.runSpeed();
   motor1.runToNewPosition(0);
   motor1.runToNewPosition(1000);
   //motor1.runToNewPosition(100);
  
      // Adaugă aici comenzi pentru motorul 1
  } else if (strcmp(command, "2") == 0) {
    motor1.setSpeed(5);
    motor1.runSpeed();
    motor1.runToNewPosition(0);
   motor1.runToNewPosition(500);
   //motor1.runToNewPosition(100);
    // Adaugă aici alte comenzi pentru motorul 1
  } else if (strcmp(command, "3") == 0) {
    motor1.setSpeed(500);
    motor1.runSpeed();
    motor1.runToNewPosition(0);
   motor1.runToNewPosition(-200);
   motor1.runToNewPosition(100);
  
    // Adaugă aici comenzi pentru motorul 2
  } else if (strcmp(command, "4") == 0) {
    motor1.setSpeed(500);
     motor2.setSpeed(500);
    motor1.runSpeed();
    motor2.runSpeed();
    motor1.runToNewPosition(0);
    motor2.runToNewPosition(0);
   motor1.runToNewPosition(500);
   motor2.runToNewPosition(500);
    // Adaugă aici alte comenzi pentru motorul 2
  } else if (strcmp(command, "A") == 0) {
    // Adaugă aici comenzi pentru ambele motoare
  } else if (strcmp(command, "B") == 0) {
    // Adaugă aici alte comenzi pentru dezactivarea ambilor motoare
  } else {
    // Tratează cazurile de comenzi necunoscute
    Serial.println("Comanda Bluetooth necunoscuta");
  }}
  


void updateBluetooth() {
}

Try swapping the middle pins:

AccelStepper motor1(AccelStepper::FULL4WIRE, motor1Pin1, motor1Pin3, motor1Pin2, motor1Pin4);
AccelStepper motor2(AccelStepper::FULL4WIRE, motor2Pin1, motor2Pin3, motor2Pin2, motor2Pin4);

setSpeed and runSpeed doesn't make any sense together with runToNewPosition(). You can simply omit that.

#define bluetoothTx 1
#define bluetoothRx 0

Which Arduino are you using? UNO/Mega/Nano/Mini?

Pins 0 and 1 are serial by default.
If you use them with your bluetooth as well, the results will be unpredictable.

That was the solution. After hours of experimenting, it was so easy. Thank you so much!

Got your feedback. Removed them

I am using UNO. About pins 0 and 1, I know. I started the code before I got my hands on Arduino. Once I saw I got the same pins by accident I thought it was fine. I can remove the lines, but do you mean I should not use those pins for my module? Except for the fact that I need to remove those pins each time I upload the code, everything seems fine. But, with all that, I am open to suggestions and improvements.