Does this happen all the time, or is it just occasional calls that give you bad readings?
You could try calling Bangle.isBarometerOn() before you run your code, to see if some other app/widget is keeping the barometer on and causing issues?
What firmware version do you have? I did make some improvements to setBarometerPower in a recent build, so if you try one of the 2v14.xxx cutting edge builds this may work better for you?
is there any other way to reset the sensors except draining the battery (which i am afraid will damage the battery)?
I'm afraid not - the sensors should be reset via software normally, but if the hardware has got 'locked up' then draining battery is the only way. I wouldn't worry about damage to the battery though - if only done a few times it's unlikely to be an issue - I let watches run flat here all the time and never have problems.
However it's extremely rate hardware gets locked up - if something like this happens routinely then it's unlikely to be a 'hardware lockup' that is the issue
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.
Does this happen all the time, or is it just occasional calls that give you bad readings?
You could try calling
Bangle.isBarometerOn()
before you run your code, to see if some other app/widget is keeping the barometer on and causing issues?What firmware version do you have? I did make some improvements to setBarometerPower in a recent build, so if you try one of the
2v14.xxx
cutting edge builds this may work better for you?I'm afraid not - the sensors should be reset via software normally, but if the hardware has got 'locked up' then draining battery is the only way. I wouldn't worry about damage to the battery though - if only done a few times it's unlikely to be an issue - I let watches run flat here all the time and never have problems.
However it's extremely rate hardware gets locked up - if something like this happens routinely then it's unlikely to be a 'hardware lockup' that is the issue