mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-19 00:41:43 +00:00
[wpilibc] Add RobotController::GetBatteryVoltage() to C++ (#3179)
This function already exists in Java.
This commit is contained in:
@@ -42,6 +42,13 @@ bool RobotController::GetUserButton() {
|
||||
return value;
|
||||
}
|
||||
|
||||
units::volt_t RobotController::GetBatteryVoltage() {
|
||||
int32_t status = 0;
|
||||
double retVal = HAL_GetVinVoltage(&status);
|
||||
wpi_setGlobalHALError(status);
|
||||
return units::volt_t{retVal};
|
||||
}
|
||||
|
||||
bool RobotController::IsSysActive() {
|
||||
int32_t status = 0;
|
||||
bool retVal = HAL_GetSystemActive(&status);
|
||||
|
||||
Reference in New Issue
Block a user