Added Battery to MenuBattery
This commit is contained in:
@@ -11,8 +11,8 @@
|
||||
|
||||
#include "menuAkku.h"
|
||||
|
||||
MenuAkku::MenuAkku() {
|
||||
|
||||
MenuAkku::MenuAkku(Battery* mainBattery) {
|
||||
this->mainBattery = mainBattery;
|
||||
}
|
||||
|
||||
void MenuAkku::right() {
|
||||
@@ -35,7 +35,7 @@ void MenuAkku::yes() {
|
||||
void MenuAkku::printMenu() {
|
||||
char buf[17];
|
||||
uint8_t controllerBattery = -1;
|
||||
uint8_t mainBattery = 77;
|
||||
uint8_t mainBattery = this->mainBattery->getBatteryPercent();
|
||||
|
||||
if( controllerBattery != Ps3.data.status.battery ){
|
||||
controllerBattery = Ps3.data.status.battery;
|
||||
|
||||
@@ -15,9 +15,10 @@
|
||||
#include <Ps3Controller.h>
|
||||
|
||||
#include "menuControl.h"
|
||||
#include "battery.h"
|
||||
|
||||
/**
|
||||
* @brief This class shows Akku informations
|
||||
* @brief This class shows battery informations
|
||||
*
|
||||
* Provide information for main battery pack and
|
||||
* PS3-Controller battery pack
|
||||
@@ -29,7 +30,7 @@ class MenuAkku : public MenuControl {
|
||||
* @brief Construct a new Menu Akku object
|
||||
*
|
||||
*/
|
||||
MenuAkku();
|
||||
MenuAkku(Battery* mainBattery);
|
||||
|
||||
void down() override {}
|
||||
void up() override {}
|
||||
@@ -53,9 +54,11 @@ class MenuAkku : public MenuControl {
|
||||
void update() override;
|
||||
|
||||
private:
|
||||
const uint16_t delay = 5000;
|
||||
const uint16_t delay = 15000;
|
||||
uint32_t last_millis = 0;
|
||||
|
||||
Battery* mainBattery;
|
||||
|
||||
};
|
||||
|
||||
#endif // MENU_AKKU_H
|
||||
|
||||
Reference in New Issue
Block a user