Log in

View Full Version : Battery Voltage


xForceDee
13-01-2013, 09:49
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.

Sam Crow
13-01-2013, 10:37
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();

jesusrambo
14-01-2013, 18:55
Here's the API page. (http://lcec.us/javadoc/edu/wpi/first/wpilibj/DriverStation.html#getBatteryVoltage())