|
Suppose you want your robot to go forward until it bumps into something, then
stop. You can use a touch sensor and the Wait for Push function
to do this:

You can read this program as:
- Begin the program
- Start motors A and C forward (go forward)
- Wait until the touch sensor connected to input
is pushed in (keep going until you bump into something)
- Stop all motors
- End the program
You can find the Wait for Push function by clicking the Wait
For
button on the Functions Palette. This brings up the subpalette
of wait functions. With wait functions, it is the program that waits at that
step, not the robot. The robot keeps going until you tell it to stop.
back | next
|