Delay with DC motors

Hi, I´m using a shild for DC motor and my arduino uno, I want once I indicate in the code to pass the pin to LOW, the motor continues to operate 30 milliseconds more and slowing down .

I tried with delay() function but all the program go into the delay.

if(350 >= v2.x && v2.x >=250 && 300 >= v2.y && v2.y >= 200){
  arduino.digitalWrite(ledPin, Arduino.HIGH);
  
}
else {
  
arduino.digitalWrite(ledPin, Arduino.LOW);

delay(3000)

}

}

If you want to keep the motor going for 0.03 seconds, why did you put a 3 second delay in?

my mistake , would mean three seconds

You need to use millis() rather than delay() to manage timing without blocking. This is illustrated in several things at a time.

...R