Forward Until Release
The Wait - Touch block can wait for the sensor to be "Released" as well as "Pressed".
What happens if you set the Wait - Touch block to "Released" and run it with an empty box holding down the sensor?
Note: When setting up robot, have the obstacle place firmly against the Touch Sensor so that it keeps it pressed in, as shown below.
The robot moves forward until the Touch Sensor is "Released", then stops. |
Mini Challenge 1: Vacuum
Program the robot to touch all four walls of a room, using its Touch Sensor to know when it has reached each one.
Use a 4x4 game board and place robot in the middle.
Program your robot to each all four walls, using its Touch Sensor.
Change to "Make sure the Touch Sensor is positioned so it can detect when the robot reaches a wall.
The room is rectangular, so each wall is a 90-degree turn from the last.
Some fine tuning may help, such as slowing movement speeds, pausing after a turn, or backing away from a wall before turning.