Skip to content
XinaBox SW01 extension for Makecode
TypeScript
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
_locales/zh
LICENSE
README.md
icon.png
pxt.json
sw01.jpg
sw01.ts Fixed issue #6 and #7 Sep 12, 2019
test.jpg
test.ts

README.md

XinaBox SW01 MakeCode extension

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

~ hint

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

~

How-to guides:

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

Core functions: Temperature:

// Show the temperature in Celcius on the micro:bit 5x5 LED matrix:
basic.showNumber(SW01.temperature(Temperature.Celcius))

// Show the temperature in Celcius on the micro:bit 5x5 LED matrix:
basic.showNumber(SW01.temperature(Temeperature.Celcius))

Core functions: Humidity:

// Show the relative humidity (as a percentage) on the micro:bit 5x5 LED matrix:
basic.showNumber(SW01.humidity())

Core functions: Atmospheric pressure:

// Show the atmospheric pressure in HectoPascals (Pascals / 100) on the micro:bit 5x5 LED matrix:
basic.showNumber(SW01.pressure(Pressure.HectoPascal))

// Show the atmospheric pressure in MilliBar (same as HectoPascal) on the micro:bit 5x5 LED matrix:
basic.showNumber(SW01.pressure(Pressure.MilliBar))

Attribution:

The library is based on BME280 Package from microbit/micropython Chinese community.

Thanks also to Shaoziyang for all the heavy lifting :)

License:

MIT

Copyright (c) 2019, XinaBox Limited

Supported targets:

  • PXT/microbit
  • PXT/CC03
  • PXT/CS11
  • PXT/CW03
You can’t perform that action at this time.