Power management progress

This commit is contained in:
2024-12-12 17:09:13 +01:00
parent 8eeb829a91
commit 51a3d9e8f6
8 changed files with 184 additions and 23 deletions

View File

@@ -5,18 +5,22 @@
#include "Dezibot.h"
#include <Wire.h>
Dezibot::Dezibot() : multiColorLight() {};
Dezibot::Dezibot():multiColorLight(){};
void Dezibot::begin(void) {
Wire.begin(SDA_PIN,SCL_PIN);
void Dezibot::begin(void)
{
Wire.begin(SDA_PIN, SCL_PIN);
infraredLight.begin();
lightDetection.begin();
lightDetection.begin();
motion.begin();
lightDetection.begin();
colorDetection.begin();
multiColorLight.begin();
display.begin();
Power.begin();
this->power = Power::getPowerManager();
if (!this->power.tryAccquirePowerAllowance(CONSUMPTION_ESP_BASE);)
{
throw "Could not allocate power for the base consumption of the ESP32";
}
};