Control#

Wait#

The Wait block is used to wait for a specific amount of time before moving to the next block.

A yellow, rectangular block with notched edges from a visual coding interface labeled 'wait 1 seconds.' The block contains an input field set to '1,' indicating that the program will pause or wait for 1 second before continuing to the next action.

Choose an amount of time to wait.

The wait block can accept decimals, integers, or numeric blocks.

In this example, the VR Robot will drive forward for 4 seconds before stopping.

A visual coding block sequence that begins with a yellow 'when started' block. Below it is a blue 'drive forward' block, followed by a yellow 'wait 4 seconds' block with an input field set to '4.' The sequence ends with a blue 'stop driving' block. This sequence will cause the robot to drive forward, wait for 4 seconds, and then stop driving.

Repeat#

The Repeat C block is used to repeat the blocks contained inside for a set number of times.

A yellow, rectangular loop block with notched edges from a visual coding interface labeled 'repeat 10.' The block contains an input field set to '10,' indicating that the enclosed actions will be repeated 10 times. The block has a space in the middle where other blocks can be placed to define the actions that will be repeated.

First enter a value to indicate how many times the stack will repeat the blocks contained inside.

The Repeat C block can accept integers or numeric blocks.

C blocks can also be put inside of each other. This concept is called nesting which can help save time when programming different behaviors.

In this example, the VR Robot will drive forward for 400 Millimeters and turn right by 90 degrees 4 times in a row to make a square.

A visual coding block sequence that begins with a yellow 'when started' block. Below it is a yellow 'repeat 4' loop block, indicating that the enclosed actions will be repeated 4 times. Inside the loop, there is a blue 'drive forward for 400 mm' block, followed by a blue 'turn right for 90 degrees' block. This sequence will cause the robot to drive forward 400 mm and then turn right 90 degrees, repeating this sequence four times.

Forever#

The Forever C block is used to repeat any blocks contained inside forever.

A yellow, rectangular loop block with notched edges from a visual coding interface labeled 'forever.' This block indicates that the enclosed actions will be repeated indefinitely. The block has a space in the middle where other blocks can be placed to define the actions that will continuously loop.

Place blocks in a Forever C block to have those actions repeat forever.

You can exit a Forever C block by placing a break block inside.

C blocks can also be put inside of each other. This concept is called nesting which can help save time when programming different behaviors.

In this example, the Forever block is used to continuously check if the Left bumper has been pressed as the VR Robot drives forward.

A visual coding block sequence that begins with a yellow 'when started' block. Below it is a blue 'drive forward' block, followed by a yellow 'forever' loop block, indicating that the enclosed actions will be repeated indefinitely. Inside the loop, there is a yellow 'if-then' block containing a condition with a blue, diamond-shaped block that checks if the 'LeftBumper' is pressed. If the LeftBumper is pressed, the sequence triggers the action 'stop driving' using a blue block.

If then#

The If then C block is used to run the blocks inside, if the Boolean condition reports True.

A yellow, rectangular conditional block with notched edges from a visual coding interface labeled 'if then.' The block has a diamond-shaped slot in the center where a condition can be placed. Below the slot is a space where blocks can be added to define the actions that will occur if the condition is met.

The If then C block will only check the Boolean condition once.

If the Boolean condition reports True, the blocks inside of the C block will run.

If the Boolean condition reports False, the blocks inside of the C block will be skipped.

The If then C block can accept hexagonal (six-sided) shaped blocks as its condition.

In this example, the If then block is continuously checked to see if the Left Bumper is pressed. If the bumper is pressed, the Drivetrain will stop.

A visual coding block sequence that begins with a yellow 'when started' block. Below it is a blue 'drive forward' block, followed by a yellow 'forever' loop block, indicating that the enclosed actions will be repeated indefinitely. Inside the loop, there is a yellow 'if-then' block containing a condition with a blue, diamond-shaped block that checks if the 'LeftBumper' is pressed. If the LeftBumper is pressed, the sequence triggers the action 'stop driving' using a blue block.

If then else#

The If then else C block is used to run the blocks inside the first or second parts of the if then else, based on the Boolean value reported.

A yellow, rectangular conditional block with notched edges from a visual coding interface labeled 'if then else.' The block has a diamond-shaped slot in the center where a condition can be placed. Below the condition slot, there are two spaces: one for blocks to define the actions that will occur if the condition is met ('then'), and another for actions that will occur if the condition is not met ('else').

The If then else C block will only check the Boolean condition once.

If the Boolean condition reports True, the blocks inside of the if section will be run.

If the Boolean condition reports False, the blocks inside of the else section will be run.

The If then else C block can accept hexagonal (six-sided) shaped blocks as its condition.

In this example, the If then else block is continuously checked to see if the Front Distance Sensor has detected an object. If the sensor detected an object, the VR Robot will drive forward, otherwise, it will turn to the right.

A visual coding block sequence that begins with a yellow 'when started' block. Below it is a yellow 'forever' loop block, indicating that the enclosed actions will be repeated indefinitely. Inside the loop, there is a yellow 'if-else' block with a condition that checks if the 'FrontDistance' sensor has 'found an object.' If the sensor detects an object, the sequence triggers the action 'drive forward' using a blue block. If no object is detected, the 'else' action is to 'turn right' using a blue block.

If then else if then else#

The If then else if then else C block is used to run the blocks inside the first set of internal blocks in the If then else if then else C block where the condition returns True.

A yellow, rectangular conditional block with notched edges from a visual coding interface labeled 'if else if else.' The block has diamond-shaped slots for conditions at the 'if' and 'else if' sections, where conditions can be placed. Below each condition slot, there is space for blocks that define the actions that will occur if the condition is met. The 'else' section has a space where blocks can be placed for actions to occur if none of the conditions are met.

The If then else if then else C block will only check the Boolean condition once.

If the Boolean condition reports True, the blocks inside the if section will run.

If the Boolean condition reports False, the If then else if then else C block will check the first of the else if lines. For each else if line, the block will check if the Boolean condition is reports True. If it is true, the internal blocks directly under that line will run before continuing on to the next block under the If then else if then else C block.

If all the Boolean conditions for the else if lines report False, the blocks inside of the else section will be run.

The If then else if then else C block can accept hexagonal (six-sided) shaped blocks as its condition.

To add another else if condition, click on the + on the else line. This will add a new else if condition to the bottom of the current list.

To remove an else if condition, click on the - on the else line. This will remove the last else if condition line, but will not delete any used blocks in the condition.

In this example, the If then else if then else block is checked continuously to see if the Down Eye Sensor has detected the color green, then blue. If it detects the color green, the VR Robot will turn right by 90 degrees, If it detects the color blue, the VR Robot will turn left by 90 degrees. If the Down Eye Sensor detects nothing, the VR Robot will drive forward.

A visual coding block sequence that begins with a yellow 'when started' block. Below it is a yellow 'forever' loop block, indicating that the enclosed actions will be repeated indefinitely. Inside the loop, there is a yellow 'if-else if-else' block with multiple conditions. The first condition checks if the 'DownEye detects green.' If true, the sequence triggers the action 'turn right for 90 degrees' using a blue block. The second condition checks if the 'DownEye detects blue.' If true, the sequence triggers the action 'turn left for 90 degrees' using a blue block. If neither condition is met, the 'else' action is to 'drive forward' using a blue block.

Wait until#

The Wait until block is used to wait for a Boolean block to report True before moving to the next block.

A yellow, rectangular block with notched edges from a visual coding interface labeled 'wait until.' The block has a diamond-shaped slot on the right side where a condition can be placed. This block will pause the execution of the program until the specified condition is met.

The Wait until block will repeatedly check a Boolean reporter block and will not move to the next block until the Boolean report block reports True.

The Wait until Boolean block can accept hexagonal (six-sided) shaped blocks.

In this example, the VR Robot will drive forward until its current Y position in Millimeters is greater than 300, then it will stop.

A visual coding block sequence that begins with a yellow 'when started' block. Below it is a blue 'drive forward' block, followed by a yellow 'wait until' block. The 'wait until' block contains a condition, placed inside a green diamond-shaped block, that checks if the 'position Y in mm' is greater than 300. Once this condition is met, the sequence triggers the action 'stop driving' using a blue block.

Repeat until#

The Repeat until C block is used to repeat the blocks inside until the Boolean condition reports True.

A yellow, rectangular block with notched edges from a visual coding interface labeled 'repeat until.' The block has a diamond-shaped slot on the right side where a condition can be placed. The block will repeat the enclosed actions until the specified condition is met.

The Repeat until C block will only check the Boolean condition at the beginning of each loop.

If the Boolean condition reports False, the blocks inside of the block will run.

If the Boolean condition reports True, the blocks inside of the block will be skipped.

The Repeat until C block can accept hexagonal (six-sided) shaped blocks as its condition.

In this example, the VR Robot will move forward in 100 Millimeter increments, waiting 1 second after each movement. The Repeat until block will repeat those movements until the Y position of the VR Robot is greater than 300 Millimeters.

A visual coding block sequence starting with a yellow 'when started' block. Below it is a yellow 'repeat until' block with a condition inside a green hexagon-shaped block that checks if the 'position Y in mm' is greater than '300.' Within the loop is a blue block that says 'drive forward for 100 mm' followed by a yellow block that says 'wait 1 seconds'.

While#

The While C block is used to repeat the blocks inside while the Boolean condition reports True.

A yellow coding block labeled 'while' with a hexagon-shaped placeholder for a condition. The block is designed to contain other blocks inside it, forming a loop that will continue to run as long as the condition is true.

The While C block will only check the Boolean condition at the beginning of each loop.

If the Boolean condition is reports True, the blocks inside of the block will run.

If the Boolean condition is reports False, the blocks inside of the block will be skipped.

The While C block can accept hexagonal (six-sided) shaped blocks as its condition.

In this example, the VR Robot will drive forward while the Brain’s timer is less than 3 seconds. Once the timer is greater than 3 seconds, the Drivetrain will stop.

A set of coding blocks that instructs a robot to 'Drive forward when the timer reads less than 2 seconds.' The sequence starts with a 'when started' block followed by a 'while' loop that checks if the 'timer in seconds' is less than 2. If the condition is met, the robot will 'drive forward,' and when the condition is no longer true, the robot will 'stop driving.'"

Break#

The Break block is used to exit a repeating loop immediately.

A single coding block labeled 'break' with rounded edges. This block is typically used to exit a loop or stop a sequence of actions prematurely within the coding structure.

When added to a repeating C block, the Break block will exit the loop it is currently in.

In this example, the VR Robot will drive forward until the Front Eye Sensor detects that it is near an object. Once detected, it will stop checking the If then statement and stop the Drivetrain.

A stack of coding blocks arranged vertically. The sequence starts with a yellow 'when started' block, followed by a blue 'drive forward' block. An orange 'forever' loop is next, containing an orange 'if' block that checks if the 'FrontEye is near object?' Inside the 'if' block is an orange 'break' block. The sequence ends with a blue 'stop driving' block.

Stop project#

The Stop project block is used to stop a running project

An orange coding block with the label 'stop project' written on it. It does not have notches on its bottom, showing that blocks can not be connected beneath it.

In this example, the VR Robot will drive forward for two seconds before the project stops.

A sequence of coding blocks starting with a yellow 'when started' block, followed by a blue 'drive forward' block, an orange 'wait 2 seconds' block, and ending with an orange 'stop project' block.