ST LPS22 Pressure Sensor I2C extension for makecode.
Author: shaoziyang
Date: 2019.Jul
basic.forever(function () {
serial.writeValue("T", LPS22.temperature(LPS22.LPS22_T_UNIT.C))
serial.writeValue("P", LPS22.pressure(LPS22.LPS22_P_UNIT.hPa))
serial.writeValue("A", LPS22.altitude())
basic.pause(1000)
})
Note Because MakeCode power function error (see issue #2192)! So altitude() use approximate calculation method instaed.
MIT
Copyright (c) 2018, microbit/micropython Chinese community
- for PXT/microbit