pub struct RobotBase {}
Implementations§
Source§impl RobotBase
Though many methods are static for convenience, they will error if a
a RobotBase
has not already been constructed.
impl RobotBase
Though many methods are static for convenience, they will error if a
a RobotBase
has not already been constructed.
Sourcepub fn new() -> Result<RobotBase, RobotBaseInitError>
pub fn new() -> Result<RobotBase, RobotBaseInitError>
Create a new robot, initializing hardware in the process. Call before initializing any other wpilib stuff.
Sourcepub fn start_competition()
pub fn start_competition()
Call when your robot is ready to be enabled. Make sure your hardware and threads have been created, etc.
pub fn make_ds(&self) -> DriverStation<'_>
Sourcepub fn fpga_version() -> HalResult<i32>
pub fn fpga_version() -> HalResult<i32>
Return the FPGA Version number.
For now, expect this to be competition year.
Sourcepub fn fpga_revision() -> HalResult<i64>
pub fn fpga_revision() -> HalResult<i64>
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.
Sourcepub fn fpga_time() -> HalResult<u64>
pub fn fpga_time() -> HalResult<u64>
Read the microsecond-resolution timer on the FPGA.
Returns The current time in microseconds according to the FPGA (since FPGA reset).
Sourcepub fn fpga_time_duration() -> HalResult<Duration>
pub fn fpga_time_duration() -> HalResult<Duration>
Read the microsecond-resolution timer
on the FPGA as a std::time::Duration
.
Get the state of the “USER” button on the roboRIO.
True if the button is currently pressed.
Sourcepub fn is_browned_out() -> HalResult<bool>
pub fn is_browned_out() -> HalResult<bool>
Reuturns true if the robot is browned out.
Sourcepub fn is_system_active() -> HalResult<bool>
pub fn is_system_active() -> HalResult<bool>
Returns true if outputs are enabled. A false result could be caused by a disabled robot or a brownout.
Sourcepub fn battery_voltage() -> HalResult<f64>
pub fn battery_voltage() -> HalResult<f64>
Get the robot’s current battery voltage.