- battery calc now more efficent

- new battery values now every 0.5s
This commit is contained in:
2023-09-04 15:52:34 +02:00
parent befbd898cc
commit 1d56a2a36d
4 changed files with 20 additions and 8 deletions
+2 -1
View File
@@ -88,13 +88,14 @@ class Battery : public Component {
uint8_t batteryPercent = 0;
uint8_t batteryLowPercent = 10;
uint8_t bufferPos = 0;
uint8_t calulationDelayMultiplier = 10;
uint8_t calulationDelayMultiplier = 5;
uint8_t loopCounter = 0;
uint16_t adcBuffer[bufferSize];
uint32_t r1 = 0;
uint32_t r2 = 0;
bool calculatetNewValues = false;
double batteryVoltage = 0;
double batteryVoltageFactor;
const float capacityVoltages[21] = {9.82, 10.83, 11.06, 11.12, // 0 5 10 15
11.18, 11.24, 11.3, 11.36, // 20 25 30 35