Hc-sro4 and l293d motor shield coding

Need Help with coding for Hc-sro4 and l293d motor shield. trying to have ultrasonic senor control motor to reverse when object is detected but have motor moving forward until then. have ultra sonic sensor trig pin A0 and echo pin A1,

Have you tried to Google something like "Hc-sro4 and l293d motor shield".

Or even Google "Obstacle avoiding robot". That's how they work and plenty of them use the HC-SR04 and the ancient, inefficient L293D or the L298 which is very similar.