RobotController

class wpilib.RobotController[source]

Bases: object

Contains functions for roboRIO functionality.

static getBatteryVoltage()[source]

Read the battery voltage.

Return type:float
Returns:The battery voltage in Volts.
static getCANStatus()[source]

Get the current status of the CAN bus.

Returns:The status of the CAN bus as a tuple: “percentBusUtilization”, “busOffCount”, “txFullCount”, “receiveErrorCount”, “transmitErrorCount”
static getCurrent3V3()[source]

Get the current output of the 3.3V rail.

Return type:float
Returns:The controller 3.3V rail output current value in Volts
static getCurrent5V()[source]

Get the current output of the 5V rail.

Return type:float
Returns:The controller 5V rail output current value in Amps
static getCurrent6V()[source]

Get the current output of the 6V rail.

Return type:float
Returns:The controller 6V rail output current value in Amps
static getEnabled3V3()[source]

Get the enabled state of the 3.3V rail. The rail may be disabled due to a controller brownout, a short circuit on the rail, or controller over-voltage.

Return type:bool
Returns:The controller 3.3V rail enabled value
static getEnabled5V()[source]

Get the enabled state of the 5V rail. The rail may be disabled due to a controller brownout, a short circuit on the rail, or controller over-voltage.

Return type:bool
Returns:The controller 5V rail enabled value
static getEnabled6V()[source]

Get the enabled state of the 6V rail. The rail may be disabled due to a controller brownout, a short circuit on the rail, or controller over-voltage.

Return type:bool
Returns:The controller 6V rail enabled value
static getFPGARevision()[source]

Return the FPGA Revision number. The format of the revision is 3 numbers. The 12 most significant bits are the Major Revision. the next 8 bits are the Minor Revision. The 12 least significant bits are the Build Number.

Return type:int
Returns:FPGA Revision number.
static getFPGATime()[source]

Read the microsecond timer from the FPGA.

Return type:int
Returns:The current time in microseconds according to the FPGA.
static getFPGAVersion()[source]

Return the FPGA Version number. For now, expect this to be the current year.

Return type:int
Returns:FPGA Version number.
static getFaultCount3V3()[source]

Get the count of the total current faults on the 3.3V rail since the controller has booted.

Return type:int
Returns:The number of faults
static getFaultCount5V()[source]

Get the count of the total current faults on the 5V rail since the controller has booted.

Return type:int
Returns:The number of faults
static getFaultCount6V()[source]

Get the count of the total current faults on the 6V rail since the controller has booted.

Return type:int
Returns:The number of faults
static getInputCurrent()[source]

Get the input current to the robot controller.

Return type:float
Returns:The controller input current value in Amps
static getInputVoltage()[source]

Get the input voltage to the robot controller.

Return type:float
Returns:The controller input voltage value in Volts
static getUserButton()[source]

Get the state of the “USER” button on the roboRIO.

Return type:bool
Returns:true if the button is currently pressed down
static getVoltage3V3()[source]

Get the voltage of the 3.3V rail.

Return type:float
Returns:The controller 3.3V rail voltage value in Volts
static getVoltage5V()[source]

Get the voltage of the 5V rail.

Return type:float
Returns:The controller 5V rail voltage value in Volts
static getVoltage6V()[source]

Get the voltage of the 6V rail.

Return type:float
Returns:The controller 6V rail voltage value in Volts
static isBrownedOut()[source]

Check if the system is browned out.

Return type:bool
Returns:True if the system is browned out
static isSysActive()[source]

Gets a value indicating whether the FPGA outputs are enabled. The outputs may be disabled if the robot is disabled or e-stopped, the watchdog has expired, or if the roboRIO browns out.

Return type:bool
Returns:True if the FPGA outputs are enabled.