Python#

This site provides a detailed reference for all the Python commands available in VEXcode AIM. Each command entry includes descriptions, parameters, and usage examples to help you understand how to use them effectively.

Command Categories#

Python commands in VEXcode AIM are grouped by their functionality. Understanding these categories helps in using them effectively.

Method Type

Description

Example

Actions

Performs an action such as logging, printing, or moving.

robot.move_at moves the AIM Robot continuously at the specified angle until a new movement method is called or the project is stopped.

Mutators

Updates object attributes.

robot.set_move_velocity assigns the move velocity of the robot with the new set value.

Getters

Used to retrieve data.

controller.button_up.pressing checks if the up button is being pressed.

Properties

Attributes associated with an object. Not a method.

centerx is a property of the tuple returned by the AI Vision snapshot, returning an integer value of the object’s center X coordinate from 0 to 240.

Callbacks

Stores and invokes a function later, often triggered by an event.

controller.button_up.pressed registers a function to be called when the Up button is pressed.

Reading a Command Entry#

Each command entry follows a consistent structure:

  • 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 formatted as a code block.

Example Command Entry#

set_console_text_color#

set_console_text_color sets the color of all subsequent print commands.

Usage:
set_console_text_color(color)

Parameter

Description

color

The color to set:
BLACK, BLUE, CYAN, GREEN, ORANGE, PURPLE, RED, TRANSPARENT, WHITE, or YELLOW.

# Display a green message on the Console
set_console_text_color(GREEN)
print("I am green!")