Batería#
Introducción#
The battery class is derived from the brain base class and provides access to the EXP 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 brain’s 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 EXP Brain
brain Brain = brain();
Voltaje#
Returns the voltage of the EXP Brain battery. Voltage is the electrical pressure supplied to the battery, which can help you check whether the battery is charged enough for the robot to run reliably.
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, ranging from 7.0 to 8.0 V or 7000 to 8000 mV.
actual#
Returns the electrical current drawn from the EXP Brain battery. Current is how much electrical flow the robot is using from the battery, which can help you see how hard the robot is working or whether motors may be under extra load.
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 EXP Brain battery in amperes, ranging from 0.0 to 15.0 Amps.
capacidad#
Returns the remaining battery level of the EXP Brain battery.
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 EXP 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).