Package edu.wpi.first.wpilibj
Class RobotController
java.lang.Object
edu.wpi.first.wpilibj.RobotController
public final class RobotController extends Object
Contains functions for roboRIO functionality.
-
Method Summary
Modifier and Type Method Description static doublegetBatteryVoltage()Read the battery voltage.static doublegetBrownoutVoltage()Get the current brownout voltage setting.static CANStatusgetCANStatus()Get the current status of the CAN bus.static doublegetCurrent3V3()Get the current output of the 3.3V rail.static doublegetCurrent5V()Get the current output of the 5V rail.static doublegetCurrent6V()Get the current output of the 6V rail.static booleangetEnabled3V3()Get the enabled state of the 3.3V rail.static booleangetEnabled5V()Get the enabled state of the 5V rail.static booleangetEnabled6V()Get the enabled state of the 6V rail.static intgetFaultCount3V3()Get the count of the total current faults on the 3.3V rail since the controller has booted.static intgetFaultCount5V()Get the count of the total current faults on the 5V rail since the controller has booted.static intgetFaultCount6V()Get the count of the total current faults on the 6V rail since the controller has booted.static longgetFPGARevision()Return the FPGA Revision number.static longgetFPGATime()Read the microsecond timer from the FPGA.static intgetFPGAVersion()Return the FPGA Version number.static doublegetInputCurrent()Get the input current to the robot controller.static doublegetInputVoltage()Get the input voltage to the robot controller.static booleangetUserButton()Get the state of the "USER" button on the roboRIO.static doublegetVoltage3V3()Get the voltage of the 3.3V rail.static doublegetVoltage5V()Get the voltage of the 5V rail.static doublegetVoltage6V()Get the voltage of the 6V rail.static booleanisBrownedOut()Check if the system is browned out.static booleanisSysActive()Gets a value indicating whether the FPGA outputs are enabled.static voidsetBrownoutVoltage(double brownoutVoltage)Set the voltage the roboRIO will brownout and disable all outputs.
-
Method Details
-
getFPGAVersion
Return the FPGA Version number. For now, expect this to be the current year.- Returns:
- FPGA Version number.
-
getFPGARevision
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.- Returns:
- FPGA Revision number.
-
getFPGATime
Read the microsecond timer from the FPGA.- Returns:
- The current time in microseconds according to the FPGA.
-
getUserButton
Get the state of the "USER" button on the roboRIO.- Returns:
- true if the button is currently pressed down
-
getBatteryVoltage
Read the battery voltage.- Returns:
- The battery voltage in Volts.
-
isSysActive
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.- Returns:
- True if the FPGA outputs are enabled.
-
isBrownedOut
Check if the system is browned out.- Returns:
- True if the system is browned out
-
getInputVoltage
Get the input voltage to the robot controller.- Returns:
- The controller input voltage value in Volts
-
getInputCurrent
Get the input current to the robot controller.- Returns:
- The controller input current value in Amps
-
getVoltage3V3
Get the voltage of the 3.3V rail.- Returns:
- The controller 3.3V rail voltage value in Volts
-
getCurrent3V3
Get the current output of the 3.3V rail.- Returns:
- The controller 3.3V rail output current value in Amps
-
getEnabled3V3
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.- Returns:
- The controller 3.3V rail enabled value
-
getFaultCount3V3
Get the count of the total current faults on the 3.3V rail since the controller has booted.- Returns:
- The number of faults
-
getVoltage5V
Get the voltage of the 5V rail.- Returns:
- The controller 5V rail voltage value in Volts
-
getCurrent5V
Get the current output of the 5V rail.- Returns:
- The controller 5V rail output current value in Amps
-
getEnabled5V
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.- Returns:
- The controller 5V rail enabled value
-
getFaultCount5V
Get the count of the total current faults on the 5V rail since the controller has booted.- Returns:
- The number of faults
-
getVoltage6V
Get the voltage of the 6V rail.- Returns:
- The controller 6V rail voltage value in Volts
-
getCurrent6V
Get the current output of the 6V rail.- Returns:
- The controller 6V rail output current value in Amps
-
getEnabled6V
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.- Returns:
- The controller 6V rail enabled value
-
getFaultCount6V
Get the count of the total current faults on the 6V rail since the controller has booted.- Returns:
- The number of faults
-
getBrownoutVoltage
Get the current brownout voltage setting.- Returns:
- The brownout voltage
-
setBrownoutVoltage
Set the voltage the roboRIO will brownout and disable all outputs.Note that this only does anything on the roboRIO 2. On the roboRIO it is a no-op.
- Parameters:
brownoutVoltage- The brownout voltage
-
getCANStatus
Get the current status of the CAN bus.- Returns:
- The status of the CAN bus
-