Read the voltage on the BAT pin

Description

 Use the MCU internal A/D module to convert the voltage on BAT pin and send the result to serial port. More detail, please refer to: TSC2046

For display equipt with touch panel only

Usage:

Direct:

"RDBAT"

Arduino:

int readBattery(void)

C:

int  Digole_readBattery(void)

Parameters:

none

Return:

integer value of converted voltage.

Example (Arduino):

int v=mydisp.readBattery();  //read the voltage on BAT pin

Example(direct)

serial.writeString("RDBAT"); //start reading the BAT pin

int c = serial.read1(); //read 2 bytes and assemble to int
c <<= 8;
c += serial.read1();
 

Changelog

Version Description
   

See Also