This block lets your robot sense its environment for a certain condition
before it continues. Use the slider or type in a value to set a trigger
point so that the program continues when sensor values are below or above it.
- The number or letter at the top right corner of the Wait block shows
the port the block is monitoring. The configuration panel, which is
described below, will let you change ports if necessary.
- If you have chosen to wait for a light, sound, or ultrasonic sensor,
this icon indicates at what level the trigger point is set; the more
colored bars displayed, the higher the trigger point. If you have chosen
to wait for a touch sensor, the icon will display the touch sensor
condition (bumped, pressed, or released) that will trigger the block and
allow the program to move on.
Configuring the Wait Block
The Control property pull-down menu will let you choose from two primary
conditions to wait for:
- Sensor (which will activate a second pull-down menu)
-
Time
Touch Sensor
Choose “Touch Sensor” and your program will wait for a touch sensor to be
bumped, pressed, or released before going on the next block in your program.
- Choose the port that the touch sensor is connected to. By default,
the block will be set to port 1 for a touch sensor.
- Use the radio buttons to specify whether you want the touch sensor
to be bumped, pressed, or released to let the program continue. Choose
Bumped if you want the block to be triggered after a quick press and
release of the touch sensor. Choose Pressed if you want the block to be
triggered at the instant the touch sensor is pressed in. Choose Released
if you want the block to be triggered at the instant the touch sensor is
released.
- The feedback box will let you test your touch sensor. When the
sensor is activated on your robot, the number 1 will be displayed here.
Sound Sensor
Choose “Sound Sensor” and your program will wait for the sound sensor to
be activated by a certain intensity of sound.
- Choose the port where your sound sensor is plugged in. By default,
the block will be set to port 2 for a sound sensor.
- Use the slider to set the trigger value or type a value into the
input box. Select the radio button to the right of the slider if you
want the block to be triggered by sound levels higher than the trigger
value; select the left radio button to trigger the block with sound
levels lower than the trigger value. You can also use the pull-down menu
to set the “true” portion of the slider.
- The feedback box displays the current sound reading (0-100%). You
can use it to try out different trigger values.
Light Sensor
Choose “Light Sensor” and your program will wait for a light sensor to be
activated by a certain intensity of light.
- Choose the port where your light sensor is plugged in. By default,
the block will be set to port 3 for a light sensor.
- Use the slider to set the trigger value or type a value into the
input box. Select the radio button to the right of the slider if you
want the block to be triggered by light levels higher than the trigger
value; select the left radio button to trigger the block with light
levels lower than the trigger value. You can also use the pull-down menu
to set the “true” portion of the slider.
- If you check the “Generated Light” checkbox, the light sensor will
turn on its own small light source and detect this light if it is
reflected back to it.
- The feedback box displays the current light reading (0-100%). You
can use it to try out different trigger values.
Ultrasonic Sensor
Choose “Ultrasonic Sensor” and your program will wait for the ultrasonic
sensor to be activated by detecting an object at a certain distance.
- Choose the port where your Ultrasonic sensor is plugged in. By
default, the block will be set to port 4 for an ultrasonic sensor.
- If you choose the radio button to the left of the slider, the block
will be triggered when it detects an object that is closer than the
trigger distance; select the right radio button to trigger the block
when it detects an object farther away than the trigger distance. Use
the slider to set the trigger distance or type a value directly into the
input box (0-250 if configured for centimeters or 0-100 if configured
for inches. Remember that highly reflective surfaces can be detected
farther away than non-reflective surfaces.
- Select to read values in Centimeters or Inches.
- The feedback box displays the current ultrasonic reading (0-250 cm
or 0-100 inches). A reading of 0 indicates the closest distance the
sensor can detect. If configured for centimeters, a reading of 250
indicates the farthest distance the sensor can detect (i.e., roughly 250
cm). If configured for inches, a reading of 100 indicates the farthest
distance the sensor can detect (i.e., roughly 100 in).
NXT Buttons
If you choose “NXT Buttons,” the program will wait for a chosen NXT
buttons to be bumped, pressed, or released before moving on.
- Select which NXT button will send out a “true” signal when activated
and cause the program to move on.
- Choose Bumped if you want the chosen button to be activated after a
quick press and release. Choose Pressed if you want the chosen button to
be activated at the instant the button is pressed in. Choose Released if
you want the chosen button to be activated at the instant the button is
released.
(Built-in) Rotation Sensor
If you choose “Rotation Sensor,” the program will advance when a motor
has turned a set number of rotations or degrees.
- Choose the port where your motor is plugged in.
- Use the radio buttons to set the direction you want: forwards or
backwards.
- Choose to count either Rotations or Degrees by using the pull-down
menu.
- Type the number of rotations or degrees you want to go by before
your program moves forward).
- The feedback box will display the current number of rotations or
degrees. Use the reset button to clear the feedback box.
Timer
If you choose “Timer,” the program will advance when one of the NXT’s
internal timers reaches a certain time value.
- Choose the NXT timer that you would like to monitor.
- Type a time value (in seconds) in the input box. You can use the
arrows to increase or decrease the value.
Receive Message
If you choose “Receive Message,” the program will advance when your NXT
receives a certain Bluetooth message.
- The pull-down menu will let you select the message type (Text,
Number, or Logic) of the message that you expect to receive.
- To compare the incoming message to a test message, either type in
the test text or number (if you have chosen Text or Number respectively
as the format), or use the radio buttons to choose the test logic value
(true or false).
- Choose the mailbox number where the incoming message will arrive.
Touch* Sensor
Choose “Touch* Sensor” and your program will wait for a touch sensor to
be bumped, pressed, or released before going on the next block in your
program.
- Choose the port that the touch sensor is connected to. By default,
the block will be set to port 1 for a touch sensor.
- Use the radio buttons to specify whether you want the touch sensor
to be bumped, pressed, or released to let the program continue. Choose
Bumped if you want the block to be triggered after a quick press and
release of the touch sensor. Choose Pressed if you want the block to be
triggered at the instant the touch sensor is pressed in. Choose Released
if you want the block to be triggered at the instant the touch sensor is
released.
- The feedback box will let you test your touch sensor. When the
sensor is activated on your robot, the number 1 will be displayed here.
Light* Sensor
Choose “Light* Sensor” and your program will wait for a light sensor to
be activated by a certain intensity of light.
- Choose the port where your light sensor is plugged in. By default,
the block will be set to port 3 for a light sensor.
- Use the slider to set the trigger value or type a value into the
input box. Select the radio button to the right of the slider if you
want the block to be triggered by light levels higher than the trigger
value; select the left radio button to trigger the block with light
levels lower than the trigger value. You can also use the pull-down menu
to set the “true” portion of the slider.
- The feedback box displays the current light reading (0-100%). You
can use it to try out different trigger values.
Rotation* Sensor
If you choose “Rotation* Sensor,” the program will advance when a
rotation* sensor has turned a set number of ticks (16 per rotation).
- Choose the port where your rotation sensor is plugged in. By
default, the block will be set to port 2 for a rotation sensor. You can
change this selection if you need to.
- Use the radio buttons to set the direction you want: forwards or
backwards.
- Set the trigger point by typing a value into the input box. Choose
greater than (>) if you want the block to be triggered when the number
of ticks (16 to a rotation) is more than the trigger value; choose less
than (<) to trigger the block when the number of ticks is less than the
trigger value.
- The feedback box will display the current number of rotations or
ticks. Use the reset button to clear the feedback box.
Temperature* Sensor
If you choose “Temperature* Sensor,” the program will advance when the
temperature reaches a certain level.
- Choose the port where the temperature sensor is plugged in. By
default, the block will be set to port 4 for a temperature sensor.
- Use the slider to set the trigger value or type a value directly
into the input box. Select the radio button to the right of the slider
if you want the block to be triggered by temperatures higher than the
trigger value; select the left radio button to trigger the block with
temperatures lower than the trigger value. You can also use the pull-down
menu to set the “true” portion of the slider.
- Select to read values in Celsius or Fahrenheit.
- The feedback box displays the current temperature reading.
Time
Choose “Time” if you want your program to hesitate for a period of time
before going on to the next block.
- Choose how many seconds you would like wait before the program moves
on. You can specify this in 1/10s of a second (example: 12,3 or 12.3 (US)).