Skip to main content

Blockly

Blockly is the visual block-based programming mode in the app.

Key behavior​

  • logic is built by arranging programming blocks
  • programs can be saved and loaded through the app workspace or model flow
  • it is well suited for repeatable robot behaviors

Toolbar​

Use the Play button in the toolbar to run the Blockly program.

As the program runs, each block is highlighted while it is being executed.

A step mode is also available. In step mode, only a single block is executed each time you click to continue.

Workspace controls​

Inside the Blockly workspace:

  • use the < button to hide or show the toolbox
  • drag a block to the trashcan to delete it
  • use the - and + buttons to adjust zoom
  • use the target button to center the workspace around your blocks

Block groups​

The available blocks are grouped by function. Common groups include:

Logic​

  • Loading block...: executes its branch when the condition evaluates to true
  • Loading block...: compares two values and returns true or false
  • Loading block...: combines two boolean values
  • Loading block...: inverts a boolean value
  • Loading block...: provides a constant true or false value

Loops​

  • Loading block...: runs a cycle a fixed number of times
  • Loading block...: repeats a cycle while a condition evaluates to true

Math​

  • Loading block...: provides a constant numeric value
  • Loading block...: performs a mathematical operation such as + or - on two values

Text​

  • Loading block...: sets a constant text value
  • Loading block...: shows a text input box at runtime
  • Loading block...: builds a text string from several inputs

Robot control groups​

  • Arm: arm motion and arm position values
  • Battery: charge and charging-state checks
  • Compass and Orientation: direction and heading values
  • Drive: movement, speed, distance, and rotation
  • Lights: LED control
  • Screen: images, animations, emotions, and text
  • Speaker: sounds, recording, and volume
  • System: timing and utility actions

Example blocks​

  • Loading block...: sets the arm position from 0 to 100
  • Loading block...: returns the current battery charge percentage
  • Loading block...: drives forward or backward for a set distance
  • Loading block...: rotates by the selected angle
  • Loading block...: sets all LEDs to the selected color
  • Loading block...: shows text on the robot screen
  • Loading block...: plays the selected sound
  • Loading block...: delays execution for the selected time

When to use it​

Use Blockly when you want to:

  • build more structured robot logic
  • revisit and refine saved programs
  • teach or learn programming visually
  • combine movement, lights, sounds, and sensors in one program

Direct control during coding​

If the robot is far away after a test run, you can use the direct control arrows in the coding view to reposition it before running the next version.