Monitoring Power - ozarchie/BlueBasic GitHub Wiki

Syntax

<variable> = BATTERY()

Description

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.

⚠️ **GitHub.com Fallback** ⚠️