diff --git a/drivers/LKCoreBattery/include/LKCoreBattery.h b/drivers/LKCoreBattery/include/LKCoreBattery.h index 8dd8154c40..04a1e5c822 100644 --- a/drivers/LKCoreBattery/include/LKCoreBattery.h +++ b/drivers/LKCoreBattery/include/LKCoreBattery.h @@ -35,7 +35,8 @@ class LKCoreBattery float battery_level_sensor_coefficient = 3.33; float resistor1 = 169; float resistor2 = 47; - float _voltage_divider_coefficient = resistor2 / (resistor2 + resistor1); + // float _voltage_divider_coefficient = resistor2 / (resistor2 + resistor1); + float _voltage_divider_coefficient = 0.125; }; } // namespace leka diff --git a/drivers/LKCoreBattery/source/LKCoreBattery.cpp b/drivers/LKCoreBattery/source/LKCoreBattery.cpp index 201f179e66..e34c3b2165 100644 --- a/drivers/LKCoreBattery/source/LKCoreBattery.cpp +++ b/drivers/LKCoreBattery/source/LKCoreBattery.cpp @@ -26,7 +26,7 @@ auto LKCoreBattery::averageVoltage(int number_of_points__for_average) -> float average += readVoltage(); } - return average / points_number_for_average; + return average / number_of_points__for_average; } auto LKCoreBattery::readVoltage(void) -> float {