how to use this h-bridge

I bought 2 h-bridges on ebay with some great specs i think, but now i can't seem to make it work.
https://www.ebay.com/itm/262935601988

this is the sketch i'm using.

int forward = 8; // forward direction pin
int reverse = 9; //reverse direction pin
int pwm = 10; //brake/pwm pin

void setup() 
{
  pinMode(8, OUTPUT);
  pinMode(9, OUTPUT);
  pinMode(10, OUTPUT);
}

void loop()
{
   digitalWrite(forward, HIGH);
   digitalWrite(reverse, LOW);   
   
   for (int i=0; i <= 240; i++)
   { 
      analogWrite(pwm, i);
      delay(50);     
   }
   
   delay(1000); 
     
   digitalWrite(forward, LOW);
   digitalWrite(reverse, HIGH);
   
   for (int i=0; i <= 240; i++)
   {
      analogWrite(pwm, i);
      delay(50);
   }
   
   delay(1000); 
}

but now the motor does not speed up properly and reverses before the arduino code does.

in the pdf are examples for the wiring, i used the last one. and set the dip switches all to on.
further i set the potentiometers for current limiting etc.. to max.

pdf here

In the first example the forward/reverse switch is conntected to ground. but how do i do that with an arduino. can i pull these pins to gound?

If you don't know the voltages in the H-bridge interface you can use a relay for the direction
switch. You could measure the voltages on the forward and reverse pins and see if they are 5V
or not. If 5V you can drive them using pinMode - setting as an OUTPUT will drive to ground,
setting as an INPUT will let the pin float (but only upto 5V, not beyond).

ok thanks a lot

Your code takes 12.5 seconds to accelerate up to full speed. Then it goes into reverse. Why not take 12 seconds to bring it back down to zero speed first?

I think it might take a bit more experimenting with the DIP switches. Maybe you have it in "joystick mode" where 50% PWM is zero speed?