Skip to content
This repository was archived by the owner on Aug 27, 2021. It is now read-only.

_BATTERY

JBtje edited this page Sep 17, 2015 · 2 revisions

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.

Note

This function does not work properly after switching SPI.

Clone this wiki locally