Battery Voltage

Hello Everyone,

This year our team switched to java so I am still getting the hang of things. One thing I would like to know is if there is any method that will get me the Voltage directly from the battery. I want the same number that shows in the driver station. Thanks in advance for the help.

The DriverStation class has a method getBatteryVoltage() that provides the voltage of the battery.
The code statement to get the voltage would be


DriverStation.getInstance().getBatteryVoltage();

Here’s the API page.