MCUHWC:GetBatteryVoltage: Difference between revisions

MarcusD (talk | contribs)
MarcusD (talk | contribs)
m Replaced "magic" with the actual meaning
 
Line 10: Line 10:
{{IPC/RequestEntry|Header code}}
{{IPC/RequestEntry|Header code}}
{{IPC/RequestEntry|Result code}}
{{IPC/RequestEntry|Result code}}
{{IPC/RequestEntry|u8 battery_voltage}}
{{IPC/RequestEntry|u8 value}}
{{IPC/RequestEnd}}
{{IPC/RequestEnd}}


=Description=
=Description=
Returns a number which can be used to calculate the voltage using this formula: <code>magic * (voltage / 256)</code> where <code>magic</code> is a constant number which seems to range somewhere between <code>4.6</code> and <code>5.0</code>. Based on calculations and battery behavior it seems like it's indeed <code>5.0</code>.
Returns a number which can be used to calculate the voltage using <code>Vref * (value / 256)</code> where <code>Vref</code> seems to be <code>5.0v</code>.




When the charger is plugged into a fully charged old3DS unit, this value will be maximum 0xD1
When the charger is plugged into a fully charged old3DS, the value will be around 0xD1 (~4.1v)


Unplugging the charger will make the value go down to 0xCE
Unplugging the charger will make the value go down to 0xCE (~4v)


The voltage at 5% battery percentage just after the LEDs start flashing is 0xAF
The voltage at 5% battery percentage just after the LEDs start flashing is 0xAF (~3.4v)


Plugging in the charger at this point will make the voltage go up to 0xB9
Plugging in the charger at this point will make the voltage go up to 0xB9 (~3.6v)