Μπαταρία#

Εισαγωγή#

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.

Πρόσβαση#

Brain.Battery

Συναρτήσεις Μελών#

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();

voltage#

Επιστρέφει την τάση της μπαταρίας EXP Brain. Η τάση είναι η ηλεκτρική πίεση που παρέχεται στην μπαταρία, η οποία μπορεί να σας βοηθήσει να ελέγξετε εάν η μπαταρία είναι αρκετά φορτισμένη ώστε το ρομπότ να λειτουργεί αξιόπιστα.

Available Functions
double voltage( voltageUnits units = voltageUnits::volt );

Parameters

Παράμετρος

Τύπος

Περιγραφή

units

voltageUnits

Optional. The unit used to represent voltage: volt (default) — volts, or mV — millivolts

Return Values

Returns a double representing the battery voltage in the specified units, ranging from 7.0 to 8.0 V or 7000 to 8000 mV.

current#

Επιστρέφει το ηλεκτρικό ρεύμα που καταναλώνεται από την μπαταρία EXP Brain. Το ρεύμα είναι η ποσότητα ηλεκτρικής ροής που χρησιμοποιεί το ρομπότ από την μπαταρία, η οποία μπορεί να σας βοηθήσει να δείτε πόσο σκληρά λειτουργεί το ρομπότ ή αν οι κινητήρες ενδέχεται να βρίσκονται υπό επιπλέον φορτίο.

Available Functions
double current( currentUnits units = currentUnits::amp );

Parameters

Παράμετρος

Τύπος

Περιγραφή

units

currentUnits

Optional. The unit used to represent current: amp (default) — amperes

Return Values

Returns a double representing the electrical current drawn from the EXP Brain battery in amperes, ranging from 0.0 to 15.0 Amps.

capacity#

Επιστρέφει το υπόλοιπο επίπεδο μπαταρίας της μπαταρίας του EXP Brain.

Available Functions
uint32_t capacity( percentUnits units = percentUnits::pct );

Parameters

Παράμετρος

Τύπος

Περιγραφή

units

percentUnits

Optional. The unit used to represent battery capacity: pct / percent — percent

Return Values

Returns a uint32_t representing the remaining battery capacity as a percentage from 0% to 100%.

temperature#

Επιστρέφει τη θερμοκρασία της μπαταρίας EXP Brain.

Available Functions

1 Επιστρέφει τη θερμοκρασία της μπαταρίας ως ποσοστό.

double temperature(
    percentUnits units = percentUnits::pct );

2 Επιστρέφει τη θερμοκρασία της μπαταρίας στις καθορισμένες μονάδες θερμοκρασίας.

double temperature(
    temperatureUnits units );

Parameters

Παράμετρος

Τύπος

Περιγραφή

units

percentUnits

Optional. The unit used to represent battery temperature: pct / percent (default) — percent

units

temperatureUnits

Returns the battery temperature in specific units: celsius — degrees Celsius, or fahrenheit — degrees Fahrenheit

Return Values

Returns a double representing the remaining battery temperature in the specified units.

Notes
  • The operating temperature range for the battery is approximately 20°C (68°F) to 70°C (158°F).