Open
Description
when arduino is powered by a out battery, it very likely that we need to konw the remain capacity of the battery.
We can't directly measure it voltage from the Ax pin by ADC because the Vref is not constant in this situation. One possible method is to "measure" the internal 1.1v voltage refenrece and set the Vcc as Vref.
Thus the out baterry voltage is 1.1 * 1024/ADC which measure range is from 1.1v to a large value.
ButArduino core does not supply a API for the function from what I see in wiring_analog.c. The function need to modify the ADCMUX register.
**So I want to add a API name like readBatteryVoltage() to implement it. **
I have test the method and it work well
Metadata
Metadata
Assignees
Labels
No labels