Programs

You can create programs by dragging Programming Blocks (from the Programming Palettes, at the bottom of the screen) onto the Programming Canvas.

When the Programming Blocks are close to each other, they will automatically snap together.



When you run your program, the Programming Blocks will be run in the order that they appear in on the screen, from left to right.
Editing Programming Blocks
Block Type: The icon indicates the Block Type
Block Handle: Click here to select or drag the block
Port Selector
Mode Selector: Click here to open the Mode Drop-Down, to select the mode
Input Parameter Values: Inputs can be selected or entered here
Sequence Plug Entry
Sequence Plug Exit
There is a detailed Help file for each Programming Block.
Sequence Wires
When Programming Blocks are not directly next to each other, you can connect them. Drag a Sequence Wire from the first block to the second block.



You can remove a Sequence Wire by clicking the Sequence Plug Entry of the second block.
Code Chunks
For long programs, it can be helpful to break the program into smaller chunks of Programming Blocks, with spaces between the code chunks. This can make it easier to understand the program.

If you click the Sequence Plug Exit of a Programming Block, a space and a Sequence Wire are created.

To remove the space and the Sequence Wire, click the Sequence Plug Exit again.

Tips and Tricks
Make a separate chunk for each different thing your robot does, to make it easier to follow the program.
Resizing Flow Programming Blocks
The Loop and Switch blocks can be resized. You can make them bigger so that other Programming Blocks can fit neatly inside. Resize these Programming Blocks by dragging the Resize Handles.



For a Switch, each condition can be resized independently.

Parallel Sequences
You can run more than one set of tasks simultaneously. For example, you might have one sequence of Programming Blocks controlling the robot’s forward motion, and a second sequence of Programming Blocks controlling the robotic arm on top of the robot.

You can create a parallel sequence by dragging a new Sequence Wire from the Sequence Plug Exit of the Programming Block before the parallel sequence:

Tips and Tricks
Watch out for Resource Conflict (shown below)! Resource conflicts can happen when running simultaneous tasks. For example, one sequence of Programming Blocks tries to steer the robot to the left, and another sequence simultaneously tries to steer the robot to the right. The EV3 Brick will perform unpredictably.
Programs
Quick links