Skip to main content

Blockly

Blockly is a visual programming mode where you create programs by connecting blocks together.

Each block represents one action, decision, or value. By joining blocks together, you create a program for the robot.

Blockly is useful when you want to teach or learn programming without writing text-based code.

When to use Blockly

Use Blockly when you want to:

  • learn programming visually
  • create repeatable robot actions
  • combine movement, lights, sounds, and sensors
  • understand programming logic step by step
  • test and improve robot behavior

Running a Blockly program

Press the Play button to run the Blockly program.

As the program runs, the app highlights the block that is currently being used. This helps users understand what the robot is doing and why.

There is also a step mode. In step mode, the program runs one block at a time. This is useful for teaching, testing, and finding mistakes.

Blockly workspace

In the Blockly workspace, you can usually:

  • add blocks from the toolbox
  • move blocks around
  • connect blocks together
  • delete blocks
  • zoom in or out
  • center the workspace around your program

Blockly block groups

Blockly blocks are grouped by function.

Common groups include:

Logic is used for decisions. For example, the robot can check if something is true or false before choosing what to do next.

Loops are used to repeat actions several times.

Math is used for numbers and calculations, such as speed, distance, brightness, or timing.

Text is used for words or messages, for example showing text on the robot's screen.

Variable is used to store values that can change while the program runs.

Functions is used to group reusable actions into named blocks that can be called later in the program.

Arm is used to move the robot's arm or check the arm position.

Battery is used to check the battery level or charging status.

Compass and Orientation is used to understand the robot's direction, angle, or position.

Drive is used to move the robot forward, backward, turn, rotate, or check its speed.

Lights is used to change LED colors.

Screen is used to show images, animations, emotions, photos, or text on the robot's display.

Speaker is used to play sounds, record sounds, or change the robot volume.

System is used for basic program actions such as waiting for a selected amount of time.

Direct control during coding

If the robot is far away from you, you can use the driving arrows to drive it closer.