Writing Your First Blocks Program
Let’s take a look at the default code template we see when we load up the program for the first time and select “Autonomous Mode”

Here’s what each block means:
Code Block | Meaning |
to runOpMode | The “OpMode” is the Operation Mode for the robot. When you load this program, this let’s the robot know to “run” every command inside this block. |
Put initialization block here | This is a comment to tell you where to put blocks that are the “startup” blocks for the robot– what happens before it starts to move, shoot discs, etc. |
call Program waitForStart | This is a default program that waits for the robot to signal it is ready to start. |
if call Program opModeIsActive | Once the robot is ready, it will signal back to the code with the “opModeIsActive” signal, letting the program know to send the blocks of code within this “if” block. |
Put run blocks here. | This is a comment to let you know where to put blocks that should run a signal time. |
Repeat while call Program opModeIsActive | This block repeats continually while the opModeIsActive signal is received from the robot. |
Put loop blocks here. | This is a comment to let you know where to put blocks that should repeat continually. |
call Telemetry update | This is where the magic happens– your code actually updates motors and actuators on the robot and the robot (or virtual robot in this case) moves accordingly. Then the whole “Repeat” block runs again. |