sensor issue

obstacle avoiding car
I am using arduino uno.I am not understanding the calculation of time of HCSR04 ultrasonic sensor in this code.Besides, when i am changing time of DC motors(mainly backward or forward function), the time is changing proportionally.But I need to get signals of ultrasonic sensor more frequently. And this code is very nice without servo motors but mostly useless with the servos.(The first one for l298n motor driver shield and the second for l293d motor driver shield).

sketch_mar09a.ino (1.72 KB)

oac2.ino (1.97 KB)

TOPIC SPLIT
DO NOT HIJACK / NECRO POST !

Could you take a few moments to Learn How To Use The Forum.
Other general help and troubleshooting advice can be found here.
It will help you get the best out of the forum in the future.

The two codes are very different. Which do you want to use?

Why do you want to read the ultrasonic sensor more often? What are you going to do with the extra reads?

Anyway if that's what you really want you will need to get rid of all those delay()s. Have a look at millis() timing instead.

Steve