Skip to main content

Create Variables

A variable is used to store values in a project. These values can be used to control the movements of the arm mounted on the VEX V5 Workcell.

Three variables will be made in this project to represent x, y, and z values.

  1. To create a variable, select the ‘Variables’ category in the Toolbox and then select ‘Make a Variable.’

    Variables category

    Note: for more information about variables, view the Storing Data tutorial video in VEXcode V5. First select the ‘Tutorials’ button in the Toolbar. 
    Tutorial button
    Then select the ‘Storing Data’ tutorial video.

    Storing Data tutorial video
  2. Name the variable for the x-coordinate ‘targetX,’ then select ‘Submit.’

    Name targetX

    Note: for more information about naming rules for variables view the Name Rules for Variable and Device article from the Knowledge Base.

  3. The variable ‘targetX’ will now appear in the ‘Variables’ category in the Toolbar.

    targetX in tool bar
  4. Repeat steps 7 and 8 to create two more variables, ‘targetY’ and ‘targetZ.’

    Target Y and Z in tool bar