Instead of moving the robot with hardcoded steps, we want to use feedback from the ultrasonic sensor to decide how to move the robot. This can be done with the loop function. At every loop we get the distance of the top wall using the ultrasonic sensor. And then we make a decision based on that distance on how to move the servos of the robot. For example, a starting strategy would be: if the distance is greater than 110 then move left. If less than 110 move right.
The coins are around 110 cm away from the top wall. Use the data from the ultrasonic sensor to navigate the robot to collect both coins.
Rotate the robot to the left
Move the robot forward for few milliseconds
Rotate the robot back to the right