WiimoteCommon: Tweak battery level math. #8908
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Wii Remotes provide an 8-bit battery level.
Documentation thought the maximum value to be decimal 200.
My testing shows this is a direct reading of the battery voltage.
The full range of values from 0 to 255 can be produced with voltages not possible from AA batteries.
For fun, a fitted equation is:
level = 176.6681 * volts - 372.1352
I've tested the battery levels required to produce 0 to 4 bars in the home menu and tweaked our battery calculations in WiimoteEmu and ControllerInterface to match this.
"Battery" settings of
0
,25
,50
,75
, and100%
now produce the matching number of bars in the home menu.Battery level "passthrough" with DSU, XInput, etc. should now be more sensible.
ControllerInterface Wii Remote battery level inputs should be more accurate.