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:
- temperature
- humidity
- atmospheric pressure.
This library provides functions that give you access to these variables, as well some measures that can be derived from them:
- dewpoint
- pressure altitude
- density altitude
- cloud base
There are 3 other functions:
- power on/off
- set address
By default the SW01 power is On, and the address is set correctly (to Off). You do NOT need to power on the SW01 or set the address to use it
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
- PXT/microbit
- PXT/CC03
- PXT/CS11
- PXT/CW03