Approved content
The content below is provided by a partner.
This library provides functions to access environmental data from the XinaBox SW01.
Read more about it or purchase one here
The SW01 uses a Bosch BME280 to report:
This library provides functions that give you access to these variables, as well some measures that can be derived from them:
There are 3 other functions:
A comprehensive set of How-to guides that show you how to use the blocks is available online: XinaBox How-to guides for the SW01 on BBC micro:bit using MakeCode
// Show the temperature in Celcius on the micro:bit 5x5 LED matrix:
basic.showNumber(SW01.temperature(SW01.Temperature.Celcius))
// Show the temperature in Celcius on the micro:bit 5x5 LED matrix:
basic.showNumber(SW01.temperature(SW01.Temeperature.Celcius))
// Show the relative humidity (as a percentage) on the micro:bit 5x5 LED matrix:
basic.showNumber(SW01.humidity())
// Show the atmospheric pressure in HectoPascals (Pascals / 100) on the micro:bit 5x5 LED matrix:
basic.showNumber(SW01.pressure(SW01.Pressure.HectoPascal))
// Show the atmospheric pressure in MilliBar (same as HectoPascal) on the micro:bit 5x5 LED matrix:
basic.showNumber(SW01.pressure(SW01.Pressure.MilliBar))
The library is based on BME280 Package from microbit/micropython Chinese community.
Thanks also to Shaoziyang for all the heavy lifting :)
MIT
Copyright (c) 2019, XinaBox Limited
SW01=github:xinabox/pxt-SW01#v1.0.23