I’ve tried the Standard WPILIB method as follows but it displays 12v which is impossible (I thnk):
// Get the current battery voltage
double batteryVoltage = RobotController.getBatteryVoltage();
// Display the voltage on the SmartDashboard with the key "Battery Voltage"
SmartDashboard.putNumber("Battery Voltage", batteryVoltage);