Control DC motor speed using Shield l293d and ultrasonic Sensor..

how i can control speed of DC motor with Shield l293d and ultrasonic sensor

lower the speed of DC motors if Obstacle is near , what function i should use in shield l293d code

ESE_AcOZ:
lower the speed of DC motors if Obstacle is near , what function i should use in shield l293d code

read the distance with whatever appropriate function your sensor library provides
if (distance < some threshold) analogWrite a "low" value to the shield's speed pin
.... else write a "higher" value

Or do you want a fully working sketch?

can you give me exemple how i use analogWrite

Man page

Example