Skip to main content

Create pointIndex Variable

Now that all 10 points have been added to the 2D List, you will need to keep track of which point the arm mounted on the VEX V5 Workcell should move towards. To do this, create a variable called "pointIndex" and set its initial value to ‘1’ for Point 1.

  1. Select the ‘Make a Variable’ button from the ‘Variables’ category in the Tool Box.

    Make a Variable block
  2. Name the variable ‘pointIndex’ and select ‘Submit.’

    pointIndex
  3. The variable ‘pointIndex’ will now appear in the ‘Variables’ category in the Tool Bar.

    pointIndex in Tool Box
  4. Select and drag the [Set variable] block from the ‘Variables’ category in the Tool Box and attach it to the [Set 2D list to] block.

    Add [Set variable]
  5. Change the variable of the [Set variable] block to ‘pointIndex’ and set the parameter to ‘1.’

    Set paramter to 1