Batería#
Introducción#
The battery class is derived from the brain base class and provides access to the V5 Brain’s battery, allowing your robot to monitor capacity, voltage, current draw, power usage, temperature, and efficiency.
Acceso#
Brain.Battery
Funciones de los miembros#
The battery class includes the following member functions:
voltage— Returns the battery voltage.current— Returns the battery current draw.capacity— Returns the remaining battery capacity.temperature— Returns the battery temperature.
Before calling any battery member functions, a brain instance must be created, as shown below:
// Create the V5 Brain
brain Brain = brain();
Voltaje#
Devuelve el voltaje de la batería del V5 Brain.
Available Functionsdouble voltage( voltageUnits units = voltageUnits::volt );
Parámetro |
Tipo |
Descripción |
|---|---|---|
|
|
Optional. The unit used to represent voltage:
|
Returns a double representing the battery voltage in the specified units.
actual#
Devuelve la corriente eléctrica extraída de la batería del V5 Brain.
Available Functionsdouble current( currentUnits units = currentUnits::amp );
Parámetro |
Tipo |
Descripción |
|---|---|---|
|
|
Optional. The unit used to represent current:
|
Returns a double representing the electrical current drawn from the V5 Brain battery in amperes.
capacidad#
Devuelve la capacidad restante de la batería V5 Brain.
Available Functionsuint32_t capacity( percentUnits units = percentUnits::pct );
Parámetro |
Tipo |
Descripción |
|---|---|---|
|
|
Optional. The unit used to represent battery capacity:
|
Returns a uint32_t representing the remaining battery capacity as a percentage from 0 to 100.
temperatura#
Devuelve la temperatura de la batería V5 Brain.
Available Functions1 — Devuelve la temperatura de la batería como un porcentaje.
double temperature( percentUnits units = percentUnits::pct );
Parameters2 — Devuelve la temperatura de la batería en las unidades de temperatura especificadas.
double temperature( temperatureUnits units );
Parámetro |
Tipo |
Descripción |
|---|---|---|
|
|
Optional. The unit used to represent battery temperature:
|
|
|
Returns the battery temperature in specific units:
|
Returns a double representing the remaining battery temperature in the specified units.
The operating temperature range for the battery is approximately
20°C(68°F) to70°C(158°F).