Block-Based Programming

This section explains the block-based programming concepts and how to use the available blocks.

Block Categories

The available blocks are organized into the following categories:

  • Movement: Blocks for controlling the robot's movement (e.g., "Drive Forward", "Turn Left").
  • Control: Blocks for controlling the flow of the program (e.g., "Repeat", "If Then").
  • Events: Blocks that trigger actions based on events (e.g., "When Program Starts", "When Button Pressed").
  • Sensing: Blocks for reading sensor data (e.g., "Get Distance", "Get Heading").
  • Operators: Blocks for performing mathematical and logical operations (e.g., "+", "=", "and").
  • Variables: Blocks for creating and manipulating variables (e.g., "Set Variable", "Get Variable").
  • My Blocks: Blocks for creating custom functions.
  • Comments: Blocks for adding comments to your code.

Connecting Blocks

To connect blocks together, simply drag a block and drop it onto another block. Blocks that can fit together will snap into place.

Block Parameters

Some blocks have parameters that you can use to customize their behavior. For example, the "Drive Forward" block has a "distance" parameter that specifies how far the robot should move.

Pro Tip

You can right-click on a block to duplicate it, delete it, or add a comment.