Battery#

Introduction#

The VEX IQ 2nd Gen Brain provides several methods to monitor the battery’s status, including its remaining capacity, voltage, and current consumption.

Below is a list of all available methods:

Methods – Get data about the Brain’s battery.

  • capacity – Returns the remaining battery capacity as a percentage.

  • voltage – Returns the voltage of the battery.

  • current – Returns the current drawn by the battery.

capacity#

capacity returns the remaining capacity of the battery as a percentage.

Usage:
brain.battery.capacity()

Parameters

Description

This method has no parameters.

# Display the current battery capacity
brain.screen.print(brain.battery.capacity())

voltage#

voltage returns the voltage of the battery as a float.

Usage:
brain.battery.voltage(units)

Parameters

Description

units

Optional. The unit that represents the voltage:

  • MV (default) – Millivolts
  • VOLT

# Display the current voltage of the battery
brain.screen.print(brain.battery.voltage())

current#

current returns the current drawn from the battery in milliamps as a float.

Usage:
brain.battery.current()

Parameters

Description

This method has no parameters.

# Display the current of the battery
brain.screen.print(brain.battery.current())