Wait Block

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.

  1. 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.
  2. 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:

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.

  1. Choose the port that the touch sensor is connected to. By default, the block will be set to port 1 for a touch sensor.
  2. 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.
  3. 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.

  1. Choose the port where your sound sensor is plugged in. By default, the block will be set to port 2 for a sound sensor.
  2. 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.
  3. 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.

  1. Choose the port where your light sensor is plugged in. By default, the block will be set to port 3 for a light sensor.
  2. 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.
  3. 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.
  4. 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.

  1. Choose the port where your Ultrasonic sensor is plugged in. By default, the block will be set to port 4 for an ultrasonic sensor.
  2. 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.
  3. Select to read values in Centimeters or Inches.
  4. 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.

  1. Select which NXT button will send out a "true" signal when activated and cause the program to move on.
  2. 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.

  1. Choose the port where your motor is plugged in.
  2. Use the radio buttons to set the direction you want: forwards or backwards.
  3. Choose to count either Rotations or Degrees by using the pull-down menu.
  4. Type the number of rotations or degrees you want to go by before your program moves forward).
  5. 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 NXTs internal timers reaches a certain time value.

  1. Choose the NXT timer that you would like to monitor.
  2. 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.

  1. The pull-down menu will let you select the message type (Text, Number, or Logic) of the message that you expect to receive.
  2. 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).
  3. 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.

  1. Choose the port that the touch sensor is connected to. By default, the block will be set to port 1 for a touch sensor.
  2. 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.
  3. 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.

  1. Choose the port where your light sensor is plugged in. By default, the block will be set to port 3 for a light sensor.
  2. 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.
  3. 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).

  1. 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.
  2. Use the radio buttons to set the direction you want: forwards or backwards.
  3. 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.
  4. 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.

  1. Choose the port where the temperature sensor is plugged in. By default, the block will be set to port 4 for a temperature sensor.
  2. 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.
  3. Select to read values in Celsius or Fahrenheit.
  4. 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.

  1. 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)).