-
Wed 2019.08.07
'not sure why the oscillation'
Basic physics, based on lack of sufficient voltage supplied.
See p.17 nominal voltage is 3v - device unpredictable below that level, especially the AD as it's readings are ratio-metric based on voltage reference
See 'Continuous Discharge Characteristics' graph in datasheet:
For this battery type, once voltage starts to fall off, functionality goes quickly.https://www.espruino.com/Reference#l_E_getBattery
"Note: this is an estimation only, based on battery voltage."The calculation
https://github.com/espruino/Espruino/blob/master/src/jswrap_espruino.c#L1745
Other discussions but for different board:
I reproduced this behavior with a flat battery showing 0 or 10 with E.getBattery(), not sure why the oscillation, but the magnetometer failed to record even though other components were still functional. Changing to a new battery brought the magnetometer back to life. firmware 1.99