NAVIGATE OBSTACLES USING ULTRASOUND SENSOR (ROBOTIC / CAR set)
Wiring shematics is on page 32. in user manual. For ULTRASONIC sensor you will need to add "SONAR" package.
When the ULTRASONIC sensor finds an obstacle, the vehicle should go back for a certain time (500 ms). The RANDOM decision requires the program to select the direction of the vehicle. After the vehicle moves to the chosen side, it moves forward again.