Skip to content

Commit

Permalink
🚧 (drivers): change coefficient value because resistors value doesn't…
Browse files Browse the repository at this point in the history
… fit documentation
  • Loading branch information
Kabroc committed Jun 22, 2021
1 parent f8de43f commit 0b3b839
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion drivers/LKCoreBattery/include/LKCoreBattery.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion drivers/LKCoreBattery/source/LKCoreBattery.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down

0 comments on commit 0b3b839

Please sign in to comment.