Knowledge Base

If Block

Let’s check out the If block, which is also known as the If…Do block.

The If block (aka the If...Do block) allows you to create conditions in your program. For example, using this block you can introduce the statement, “If the ultrasonic sensor detects a value of 50, drive straight,” into your program. The do commands will only be executed IF the condition is true.


Additional Options

Click the If block's  blue star button to add else or else if conditions to the block.



Parameter Description Compatible Blocks


Adds a condition after the If parameter.

Blocks are repeated in a loop if the condition is true. 

else if

Defines an alternate condition.

If the alternate condition is true, the commands that follow it are executed.



Commands that follow the Else parameter are executed if none of the conditions are true.



Hints and Tips

You can configure the If block to repeat commands indefinitely by adding a True block!

Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request


Please sign in to leave a comment.

Powered by Zendesk