Repeat Until Touch Sensor
Set the Loop's mode to Touch Sensor instead of Ultrasonic Sensor. Make sure the arm is raised on the robot.
The robot will check the Touch Sensor instead of the Ultrasonic Sensor
at the beginning of the Loop to see whether it will send Flow in or leave the Loop.
If the Touch Sensor is being pressed in at the time the Loop begins, the robot will stop! If not, it will move forward and backward as intended until the Touch Sensor is pressed. |
Mini Challenge 1: Square Dance 3
Facing obstacles is a very common problem a robot faces. You can use loops to anticipate the presence of an obstacle and stop the robot before it hits the object.
|
Start from the program you wrote from the previous mini-challenges, Square Dance 1 and Square Dance 2. You can create the program for this challenge by making a change just to the loop!