Ok, thanks - I see undefined returned on the first call for devices here, but subsequent ones seem ok. Widgets/etc that use getPressure should usually cope with this I think.
I think if the Barometer is actually powered on first with Bangle.setBarometerPower(1) things should be ok. So the question is now - can your Bangle ever get into that position where the barometer stops working with the new firmware?
I also had a play here and I tried waiting a bit longer before requesting data from the barometer, and it actually made matters worse - I was seeing undefined about 2 in 3 attempts! I've shortened the delay slightly and at least on my device it makes getPressure work all the time - so maybe if you try the absolute latest firmware it'll be ok
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.
Ok, thanks - I see
undefined
returned on the first call for devices here, but subsequent ones seem ok. Widgets/etc that usegetPressure
should usually cope with this I think.I think if the Barometer is actually powered on first with
Bangle.setBarometerPower(1)
things should be ok. So the question is now - can your Bangle ever get into that position where the barometer stops working with the new firmware?I also had a play here and I tried waiting a bit longer before requesting data from the barometer, and it actually made matters worse - I was seeing
undefined
about 2 in 3 attempts! I've shortened the delay slightly and at least on my device it makes getPressure work all the time - so maybe if you try the absolute latest firmware it'll be ok