If you try to gently prod the servo, you’ll discover that it’ll refuse to budge. This is because we’ve configured the code to keep the servo at a 90° position; the servo is locked at this angle. With this in mind, be sure not to forcibly pull or tug at the servo!
After downloading the code, upload it to your Romeo microcontroller. Once your car starts moving, you’ll be able to see the obstacle avoidance sensors in action. If you feel like the sensor’s distance detection isn’t sufficiently strong, feel free to further adjust the sensors.
This function is used to enable the ultrasound sensor (URM37) for use — without this function, the sensor won’t turn on and send its readings. Make sure to place this function in the void setup() portion of your code.
The below function should be placed in the void loop() portion of your code.