Generalize iRemaining & iRunTimeToEmpty calculations to support capacities != 100#30
Conversation
0b69e75 to
adabc40
Compare
|
@abratchik Would it be possible for you to take a look at this proposal? |
Hi @forderud , I checked your proposal, it's ok for me but please remove the commit amending the comment. I'm currently working on the actual UPS project where the remaining battery charge is defined using a completely different method, not involving any analog reads. That is why it is important to keep the original comment - to let other developers know that this part is only an example. |
…iFullChargeCapacity other than 100.
adabc40 to
1a1c2c9
Compare
Sure! I've now updated the PR accordingly. |
|
Does the PR look better now @abratchik ? |
The
iRemaining(capacity) andiRunTimeToEmptycalculations currently assumeiFullChargeCapacity==100. Generalize the formulas, so that they still give reasonable results also if changingiFullChargeCapacityto a smaller or larger value.