Basic Coding Blocks and How to Use Them

EVENT blocks

This is an EVENT block.  They are dark yellow with a bump on top.

Every program must have an EVENT block in order to work. 

EVENT blocks tell the computer or robot WHEN to EXECUTE (play) the commands.

If the robot does not know when to EXECUTE the commands, they will never execute them.

The EVENT block you see here is the DEFAULT event block. It is the one that will always be there when you start a new program.  It tells the robot to EXECUTE the commands as soon as you run the program by selecting it on the display , selecting the file that appears below it, and pressing the center button.

There are other EVENT blocks. 

For example, this one tells the robot to EXECUTE the commands only if the robot's light sensor detects the color green.

First, you need to select the program on the display , select the file that appears below it, and press the center button.

The program will begin running, but the robot won't actually EXECUTE the commands until the color sensor detects the color green.

MOTOR Blocks

MOTOR blocks are BLUE, and will control ONE motor at a time.

In order for a MOTOR block to work, you must select the motor you wish to control. You do this by looking at the motor on your robot and seeing which port the cable is connected to (A, B, C or D).

Then you select that letter in the MOTOR block. You will also need to indicate how many degrees you would like the motor to turn. 

(Degrees are much more precise than rotations, so it is recommended to use degrees instead of rotations.)


MOVEMENT Blocks

MOVEMENT blocks are PINK, and will control BOTH motors at the same time. When BOTH motors move the same distance together at the same time, the robot will travel in a straight line. 

The DEFAULT motors controlled by the MOVEMENT blocks are B and C, so you should have your left motor connected to port B and your right motor connected to port C.  If you want to connect them to ports other than B and C, you will need an additional command block to tell the robot that they are will not be connected to B and C.

If you would like your robot to travel BACKWARD, you can choose the BACKWARD option instead - where it says FORWARD, OR you can make the number of degrees or rotations NEGATIVE,

However, if you choose BACKWARD and ALSO make the distance NEGATIVE, the robot will move forward.

Some of the MOVEMENT block s have two spaces to control SPEED. 

100 is the maximum speed.

If the speed is NEGATIVE, the robot will move backward. 

If only ONE of the speed spaces is NEGATIVE and the other is POSITIVE, one wheel will move forward while the other moves backward. This will make the robot spin.

Command Block Pallette

On the left side of your programming screen, you will see many colored dots. These dots are shortcuts to sections of programming blocks and they are color coded.

If you click on a dot, it will take you to the programming blocks for that section.