Help with 2 steppermotors controlled by potentiometers

I've started over again and now have this code.
I'm using accelstepper.h.
I'll install it in my project tomorrow and see if it works.
I'll keep you updated.

Thanks for all your efforts so far!"

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

#define directionPin1 2
#define stepPin1 3
#define potentiometerPin1 A0
#define switchPin1 7

#define directionPin2 4
#define stepPin2 5
#define potentiometerPin2 A1
#define switchPin2 6

LiquidCrystal_I2C lcd(0x27, 16, 2);

AccelStepper stepper1(AccelStepper::DRIVER, stepPin1, directionPin1);
AccelStepper stepper2(AccelStepper::DRIVER, stepPin2, directionPin2);

int previousPotValue1 = 0;
int previousPotValue2 = 0;

void setup() {
  lcd.init();
  lcd.backlight();
  lcd.setCursor(0, 0);
  lcd.print("Speed M1: ");
  lcd.setCursor(12, 0);
  lcd.print("  % ");
  lcd.setCursor(0, 1);
  lcd.print("Speed M2: ");
  lcd.setCursor(12, 1);
  lcd.print("  % ");

  pinMode(switchPin1, INPUT_PULLUP);
  pinMode(switchPin2, INPUT_PULLUP);

  stepper1.setMaxSpeed(1000); // Set max speed in steps per second
  stepper2.setMaxSpeed(1000);

  stepper1.setAcceleration(500); // Set acceleration in steps per second^2
  stepper2.setAcceleration(500);

  stepper1.setCurrentPosition(0);
  stepper2.setCurrentPosition(0);
}

void updateLCD(float speedPercent, int motor) {
  lcd.setCursor(10, motor);
  lcd.print(speedPercent, 0);
  lcd.print(" ");
}

void loop() {
  // Stepper motor 1
  if (digitalRead(switchPin1) == LOW) {
    int potValue1 = analogRead(potentiometerPin1);
    float speedPercent1 = map(potValue1, 0, 1023, 100, 10);
    if (abs(potValue1 - previousPotValue1) > 10) {
      updateLCD(speedPercent1, 0);
      previousPotValue1 = potValue1;
    }
    int speed1 = map(potValue1, 0, 1023, 10, 1000); // Map potentiometer value to speed
    stepper1.setSpeed(speed1);
    stepper1.runSpeed();
  } else {
    stepper1.stop();
  }

  // Stepper motor 2
  if (digitalRead(switchPin2) == LOW) {
    int potValue2 = analogRead(potentiometerPin2);
    float speedPercent2 = map(potValue2, 0, 1023, 100, 10);
    if (abs(potValue2 - previousPotValue2) > 10) {
      updateLCD(speedPercent2, 1);
      previousPotValue2 = potValue2;
    }
    int speed2 = map(potValue2, 0, 1023, 10, 1000); // Map potentiometer value to speed
    stepper2.setSpeed(speed2);
    stepper2.runSpeed();
  } else {
    stepper2.stop();
  }
}