implement gyroskop

This commit is contained in:
2023-09-04 19:42:11 +02:00
parent 1d56a2a36d
commit 7c94c8cc56
9 changed files with 129 additions and 17 deletions
+2 -2
View File
@@ -15,7 +15,7 @@ Battery::Battery(uint8_t pin, uint32_t r1, uint32_t r2) {
this->pin = pin;
this->r1 = r1;
this->r2 = r2;
this->batteryVoltageFactor = (double) (this->r1 + this->r2)) / (double) this->r2
this->batteryVoltageFactor = (double) (this->r1 + this->r2) / (double) this->r2;
this->initBuffer();
this->loopDelay = 100;
}
@@ -72,7 +72,7 @@ double Battery::calculateInputVoltage() {
void Battery::calculateBatteryVoltage() {
if (this->r1 && this->r2) {
this->batteryVoltage = (this->calculateInputVoltage() * this->batteryVoltageFactor;
this->batteryVoltage = this->calculateInputVoltage() * this->batteryVoltageFactor;
return;
}