Bts 7960 motor acceleration and deceleration curve

Hello! I am new to arduino and I want to control a dc motor with the bts7960 driver and I need the code to have soft start and stop, can someone help me with this?

#include "BTS7960.h"

const uint8_t EN = 8;
const uint8_t L_PWM = 9;
const uint8_t R_PWM = 10;

BTS7960 motorController(EN, L_PWM, R_PWM);

void setup() 
{
}

void loop() 
{
  motorController.Enable();

  int speed=127;

  motorController.TurnRight(speed);
  delay(2000);

  motorController.Stop();
  
  motorController.TurnLeft(speed);
  delay(2060);

  motorController.Stop();
  motorController.Disable();
  delay(5000);
}

Try this code (not tested).

#include "BTS7960.h"

const uint8_t EN = 8;
const uint8_t L_PWM = 9;
const uint8_t R_PWM = 10;
int speed = 0;

BTS7960 motorController(EN, L_PWM, R_PWM);

void setup()
{
}

void loop()
{
  motorController.Enable();

  for(speed = 0; speed < 255; speed++)
  {
    motorController.TurnRight(speed);
    delay (100);
  }
  delay(1000);
  motorController.Stop();

  for (speed = 255; speed > 0; speed--)
  {
    motorController.TurnRight(speed);
    delay (100);
  }
  delay(1000);
  motorController.Stop();
 for (speed = 0; speed < 255; speed++)
  {
    motorController.TurnLeft(speed);
    delay (100);
  }
  delay(1000);
  motorController.Stop();

  for (speed = 255; speed > 0; speed--)
  {
    motorController.TurnLeft(speed);
    delay (100);
  }
  delay(1000);
  motorController.Stop();
  motorController.Disable();
  delay(5000);
}

25.5 sec? (0.1 * 255)

From
"https://github.com/luisllamasbinaburo/Arduino-BTS7960/blob/master/examples/BTS7960_PWM/BTS7960_PWM.ino

  for(int speed = 0 ; speed < 255; speed+=10)
  {
	motorController.TurnLeft(speed);
	delay(100);
  }  

sorry ... missed that

Soft is an adjective without measure.

Something can be smooth or violent in 25 sec.

But the most important thing is to try to help OP and not discuss incommensurables.

i think it's helpful to the OP to quantify performance
i'm curious what the OP things soft start means

Thank you all for the help, it worked as I expected but it will be very difficult for me. I have created a robotic arm with linear actuators. and controlling 3 motors with a code like this makes it very difficult to make a program. Does anyone know another way? The actuators have potentiometer feedback. what I have done with arduino was to make a manual joystick with 3 potentiometers and every time I move them it makes the actuators move forward or backward respectively, but now I need something more precise like generating a program that runs indefinitely. thanks for the contributions

thank you! it has worked perfect