Please accept this pull request to update ponewheel for user with battery modifications. I have tested against my Two-X, but it is possible a VNR modification might benefit from this, and I would be willing to make enhancements to support VNR if proposed.
This request should resolve Issue #76.
This change adds a new setting preference to allow you to choose from the following methods to report battery remaining:
Default - the default option, reports remaining they way pownewheel always has.
Voltage Output - Use the "Voltage" characteristic and follow its curve. This is the method proposed by Soren. I smooth it with a decaying average, but it still seems to fluctuate too much.
Cell Voltages - Uses the sum of the individual cells which is similar to the previous method but tends to be more stable, it also appears to be closer to accurate at more speeds. I also smooth this out with a decaying average.
Fully Charged Two-X - uses the default method until it reports the battery to be 3%, then switches to using the "Cell Voltages" method until 0. This only works if you start with a fully charged Two-X onewheel.
Please understand that I am not a Java programmer, this literally doubles the total number of lines of Java I have written in my entire life and I have also never worked on an Android app before either. So, please feel free to either merge and fix my code or let me know what needs to be fixed.
I wanted to start with a newer branch, but there was a missing crashlytics configuration file and I wasn't sure what to do about that. If you would prefer I update that branch, we can have a conversation about how to get crashlytics working. This is a pretty simple change, so it won't take long to apply by hand to a newer, non-master branch.
Please accept this pull request to update ponewheel for user with battery modifications. I have tested against my Two-X, but it is possible a VNR modification might benefit from this, and I would be willing to make enhancements to support VNR if proposed.
This request should resolve Issue #76.
This change adds a new setting preference to allow you to choose from the following methods to report battery remaining:
Please understand that I am not a Java programmer, this literally doubles the total number of lines of Java I have written in my entire life and I have also never worked on an Android app before either. So, please feel free to either merge and fix my code or let me know what needs to be fixed.
I wanted to start with a newer branch, but there was a missing crashlytics configuration file and I wasn't sure what to do about that. If you would prefer I update that branch, we can have a conversation about how to get crashlytics working. This is a pretty simple change, so it won't take long to apply by hand to a newer, non-master branch.
Thank you.