Μπαταρία#
Εισαγωγή#
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.
Πρόσβαση#
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 V5 Brain
brain Brain = brain();
voltage#
Επιστρέφει την τάση της μπαταρίας V5 Brain. Η τάση είναι η ηλεκτρική πίεση που παρέχεται στην μπαταρία, η οποία μπορεί να σας βοηθήσει να ελέγξετε εάν η μπαταρία είναι αρκετά φορτισμένη ώστε το ρομπότ να λειτουργεί αξιόπιστα.
Available Functionsdouble voltage( voltageUnits units = voltageUnits::volt );
Παράμετρος |
Τύπος |
Περιγραφή |
|---|---|---|
|
|
Optional. The unit used to represent voltage: |
Returns a double representing the battery voltage in the specified units.
current#
Επιστρέφει το ηλεκτρικό ρεύμα που καταναλώνεται από την μπαταρία V5 Brain. Το ρεύμα είναι η ποσότητα ηλεκτρικής ροής που χρησιμοποιεί το ρομπότ από την μπαταρία, η οποία μπορεί να σας βοηθήσει να δείτε πόσο σκληρά λειτουργεί το ρομπότ ή αν οι κινητήρες ενδέχεται να βρίσκονται υπό επιπλέον φορτίο, που κυμαίνεται από 0,0 έως 20,0 Αμπέρ.
Available Functionsdouble current( currentUnits units = currentUnits::amp );
Παράμετρος |
Τύπος |
Περιγραφή |
|---|---|---|
|
|
Optional. The unit used to represent current: |
Returns a double representing the electrical current drawn from the V5 Brain battery in amperes.
capacity#
Επιστρέφει το υπόλοιπο επίπεδο μπαταρίας του V5 Brain.
Available Functionsuint32_t capacity( percentUnits units = percentUnits::pct );
Παράμετρος |
Τύπος |
Περιγραφή |
|---|---|---|
|
|
Optional. The unit used to represent battery capacity: |
Returns a uint32_t representing the remaining battery capacity as a percentage from 0% to 100%.
temperature#
Επιστρέφει τη θερμοκρασία της μπαταρίας του V5 Brain.
Available Functions1 — Επιστρέφει τη θερμοκρασία της μπαταρίας ως ποσοστό.
double temperature( percentUnits units = percentUnits::pct );
Parameters2 — Επιστρέφει τη θερμοκρασία της μπαταρίας στις καθορισμένες μονάδες θερμοκρασίας.
double temperature( temperatureUnits units );
Παράμετρος |
Τύπος |
Περιγραφή |
|---|---|---|
|
|
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).