VEX V5 Python API
Public Member Functions | List of all members
vex.Competition Class Reference

Public Member Functions

def __init__ (self)
 Use this class to set up your program for competitions. More...
 
def is_enabled (self)
 Gets the status of your program. More...
 
def is_driver_control (self)
 Gets the status of the Driver Control period. More...
 
def is_autonomous (self)
 Gets the status of the Autonomous period. More...
 
def is_competition_switch (self)
 Gets the status of the Competition Control Switch being plugged into the robot. More...
 
def is_field_control (self)
 Gets the status of the Field Control System being plugged into the robot. More...
 
def autonomous (self, f)
 Calls a function on a new thread when the autonomous period starts. More...
 
def drivercontrol (self, f)
 Calls back a function on a new thread when the driver control period starts. More...
 

Constructor & Destructor Documentation

◆ __init__()

def vex.Competition.__init__ (   self)

Use this class to set up your program for competitions.

Member Function Documentation

◆ is_enabled()

def vex.Competition.is_enabled (   self)

Gets the status of your program.

Returns
Returns a Boolean based on if the autonomous or driver control periods are active. If either one are active, the Boolean will return true.

◆ is_driver_control()

def vex.Competition.is_driver_control (   self)

Gets the status of the Driver Control period.

Returns
Returns a Boolean based on if the Driver Control Period is active. If the Driver Control period is active, the Boolean will return true.

◆ is_autonomous()

def vex.Competition.is_autonomous (   self)

Gets the status of the Autonomous period.

Returns
Returns a Boolean based on if the Autonomous Period is active. If the Autonomous Period is active, the Boolean will return true.

◆ is_competition_switch()

def vex.Competition.is_competition_switch (   self)

Gets the status of the Competition Control Switch being plugged into the robot.

Returns
Returns a Boolean based on if the V5 is connected to the Competition Control Switch. If the Brain is connected, the Boolean will return true.

◆ is_field_control()

def vex.Competition.is_field_control (   self)

Gets the status of the Field Control System being plugged into the robot.

Returns
Returns a Boolean based on if the V5 is connected to the Filed Control System. If the Brain is connected, the Boolean will return true.

◆ autonomous()

def vex.Competition.autonomous (   self,
  f 
)

Calls a function on a new thread when the autonomous period starts.

That thread is interrupted when the autonomous period ends.

Parameters
fA reference to a function. Only one reference is stored, subsequent calls override any previous callbacks.

◆ drivercontrol()

def vex.Competition.drivercontrol (   self,
  f 
)

Calls back a function on a new thread when the driver control period starts.

That thread is interrupted when the driver control period ends.

Parameters
fA reference to a function. Only one reference is stored, subsequent calls override any previous callbacks.