Skip to main content

Programming with Variables

Materials Required:
Quantity Materials Needed
1

VEX V5 Workcell

1

VEXcode V5

1

Engineering Notebook

1

Device to run VEXcode V5

1

Micro-USB cable

1

Dry-erase marker

In this section, you will explore how variables are used to store values in a VEXcode V5 project. You will use three variables to start the arm mounted on the VEX V5 Workcell at the origin (0, 0, 1.5). Once the arm mounted on the V5 Workcell starts at the origin, it will move one inch along the x and y-axes to draw a line using a dry-erase marker.

You will first create three variables, one for each of the three x, y, and z coordinate axes. You will then utilize these created variables and blocks from the ‘Arm,’ ‘Control,’ ‘Operators,’ and ‘Variables’ categories to program the V5 Workcell’s movement. To finish the activity, you will use variables and repeat loops to move the arm mounted on the V5 Workcell using incremental movements.

You will begin by creating the ‘Variable’ project.