-
Notifications
You must be signed in to change notification settings - Fork 2
_BATTERY
<variable> = BATTERY()
The lower power nature of the CC245X device make it ideal to use with a battery. With careful power management, a device can run for years on a few AA batteries. But power will eventually run out, so it is useful to be able to monitor it.
The BATTERY() function returns the current voltage being supplied to the chip, in millivolts (mV). For example:
PRINT BATTERY()
2500
OK
The battery level here is 2.5V. The application can use this to estimate how much power remains.
This function does not work properly after switching SPI.
FOR
IF
GOSUB
DIM
LIST
MEM -
NEW
RUN
END
GOTO
REM
PRINT
REBOOT
RETURN
AUTORUN
CONFIG -
ABS
LEN !
RND
+
-
*
/
%
&
|
^
>
>=
<
<=
=
==
!=
<<
>>
//
TIMER
MILLIS -
DELAY
PINMODE
RISING -
FALLING -
INTERRUPT -
ATTACH -
DETACH -
SERIAL
SPI
ANALOG
I2C
WIRE
TIMEOUT -
WAIT -
PULSE -
BATTERY
GATT
WRITENORSP -
NOTIFY -
INDICATE -
GATT ONREAD -
GATT ONWRITE -
GATT ONCONNECT
GATT ONDISCOVER -
ADVERT
SCAN
ACTIVE -
DUPLICATES -
BTPOKE
BTPEEK