Python#

This guide provides detailed information on how to use the Python methods in VEXcode CTE. Here, you will learn how to read and understand each method, with comprehensive descriptions, parameters, and usage examples.

Understanding the Method Entries#

Each method entry in the API Reference includes the following components:

  • Command Name – The official name of the command.

  • Description – A brief explanation of what the command does and what it may return.

  • Definition – The syntax of the command, showing how it should be written in code.

  • Parameter Table – Lists all inputs the command accepts.

  • Example Code – A usage example provided as a copy-and-paste code block.

Example Method Entry#

move_inc#

move_inc moves the 6-Axis Arm by a specified distance along the x, y, and z axes.

This method will return a Boolean indicating whether the 6-Axis Arm has reached the requested position:

  • True — The 6-Axis Arm has reached the requested position.

  • False — The 6-Axis Arm cannot reach the requested position.

Usage:
arm.move_inc(x, y, z, wait)

Parameter

Description

x

The distance to move along the x-axis in millimeters.

y

The distance to move along the y-axis in millimeters.

z

The distance to move along the z-axis in millimeters.

wait

Optional.

  • wait=True (default) – The project waits until move_inc is complete before executing the next line of code.
  • wait=False – The project starts the action and moves on to the next line of code right away, without waiting for move_inc to finish.

# Move the Arm +100 millimeters on the y-axis
arm.move_inc(0, 100, 0)