Yes, a PR with some updated docs would be great. If you could focus on magnetometer that'd be great, as I think getting the light readings reliable might be a relatively easy fix.
I guess really it's just mentioning that the magnetometer can drop out when the battery is low. Note that Puck.mag() on its own (without magOn) is unlikely to have the problem as it starts the magnetometer, reads, and shuts it off again.
Also: getBatteryPercentage reads the battery voltage between 2.0 and 2.8v and converts it to a percentage (linearly) - but the battery discharge is non-linear.
So 38% is around 2.3v, which I guess is really nearer 5-10% charge.
If someone wanted to come up with a better function that'd be awesome. Probably a 1/volts relationship would map quite well :)
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
Yes, a PR with some updated docs would be great. If you could focus on magnetometer that'd be great, as I think getting the light readings reliable might be a relatively easy fix.
I guess really it's just mentioning that the magnetometer can drop out when the battery is low. Note that
Puck.mag()
on its own (withoutmagOn
) is unlikely to have the problem as it starts the magnetometer, reads, and shuts it off again.Also: getBatteryPercentage reads the battery voltage between 2.0 and 2.8v and converts it to a percentage (linearly) - but the battery discharge is non-linear.
So 38% is around 2.3v, which I guess is really nearer 5-10% charge.
If someone wanted to come up with a better function that'd be awesome. Probably a
1/volts
relationship would map quite well :)1 Attachment