Robot App™ Description
This robot's mission is to explore all around your room, house, or wherever you set it loose. It tries to "see" walls and other obstacles before running into them, and then turns its head to look left and right to determine which direction looks the best to turn.
In case it does accidentally run into something, a bumper in the front triggers a touch sensor to make the robot stop and then decide which way to turn.
This program makes the robot repeat the following steps:
1. Go straight until either the ultrasonic sensor sees something close or the bumper is hit.
2. If the bumper was hit, make a sound and back up a little.
3. Turn the head to look right and then left, and use the ultrasonic sensor to determine which direction appears to have more space, then turn in that direction.