The Loop block is a container that can hold a sequence of programming blocks. It will make the sequence of blocks inside it repeat. You can choose to repeat the blocks forever, a certain number of times, or until a sensor test or other condition is True.
Only the blocks inside the loop will repeat. After the loop ends, the program will continue with the blocks that are after the loop.
|Brick Buttons - Brick Buttons||Loop repeats until one of the selected buttons does the selected action.|
See Using the Brick Buttons.
|Color Sensor - Color||Loop repeats until one of the selected colors is detected. |
See Using the Color Sensor.
|Infrared Sensor – Remote||Loop repeats until one of the selected buttons on the IR Beacon is pressed. |
See Using the Infrared Sensor Remote Mode.
|Touch Sensor - State||Loop repeats until the Touch Sensor is in the selected state.|
See Using the Touch Sensor.
|Ultrasonic Sensor – Presence/Listen||Loop repeats until an Ultrasonic signal is detected.|
See Using the Ultrasonic Sensor.
|Messaging||Loop repeats until the specified message type is received. |
See Messaging Block.
|Count||Numeric||Number of times to repeat the loop in Count mode.|
|Seconds||Numeric||Number of seconds to repeat the loop in Time mode.|
|Until||Logic||In Logic mode, the loop will end when this input is True.|
|Compare Type||Numeric||Comparison type for a Sensor Mode with a Threshold Value.|
0: = (Equal)
1: ≠ (Not Equal)
2: > (Greater Than)
3: ≥ (Greater Than or Equal To)
4: < (Less Than)
5: ≤ (Less Than or Equal To)
|Threshold Value||Numeric||Value to compare sensor data to for a Sensor Mode with a Threshold Value.|
|(Inputs for individual sensor types)||See the help on the individual sensor types for more information on the sensor data.|