GetBatteryVoltage

Availability All terminals
Description Returns the output voltage level of the battery pack in millivolts.
Syntax unsigned int GetBatteryVoltage( void );
Arguments None
Returns The output voltage level of the battery pack in millivolts.
Remarks The relation between the battery pack output voltage level and the remaining battery capacity depends on the type of batteries and on the charging and discharging history. It is difficult if not impossible to determine the remaining battery capacity from the battery voltage precisely.
Example
#include <stdio.h>
#include <stdlib.h>
#include "lib.h"

void main( void )
{
    unsigned int voltage;

    printf("\nBattery voltage:");

    for(;;)
    {
        voltage = GetBatteryVoltage();
        printf("\r%dmV", voltage);
        Sound(TCLICK, VMEDIUM, SHIGH, 0);
        Delay(5*50);
    }
}