GetBatteryVoltageYou can use the
GetBatteryVoltagefunction to find out the battery voltage.
Fixed GetBatteryVoltage(short whichBattery);
- The battery for which you want a voltage reading.
GetBatteryVoltagefunction returns the battery voltage as a fixed-point number.
The value of
whichBatteryshould be in the range 0 to
BatteryCount()-1. If the value of
whichBatteryis out of range, or the selected battery is not installed,
GetBatteryVoltagewill return a result of 0.0 volts.
ASSEMBLY-LANGUAGE INFORMATIONThe trap is
_PowerMgrDispatch($A09E). The selector value for
GetBatteryVoltageis 27 ($1B) in the low word of register D0. The battery number is passed in the high word of register D0. The 32-bit value of the battery voltage is returned in register D0.