Skip to content

Sensirion/makecode-extension-sfa30

Repository files navigation

Sensirion SFA30 Makecode Extension

Makecode extension for the Sensirion SFA30 evaluation kit connected to the micro:bit platform.

This extension allows you to read formaldehyde, temperature and relative humidity values with an interval of 0.5 second.

SFA30 Evaluation Kit

Supported Targets

  • PXT/microbit
  • Calliope mini

I2C Address

  • 0x5D

Usage

open your microbit makecode project, in "+ Extension", paste the following URL:

https://github.com/Sensirion/makecode-extension-sfa30

Demo

API

Get formaldehyde value in ppb (parts per billion)

function get_formaldehyde()

Get temperature in degree celsius. Takes an optional argument to change to fahrenheit.

function get_temperature()

Get relative humidity in percent

function get_relative_humidity()

Start measurement on SFA30 evaluation kit. This method will be automatically called on initialization. If you call stop_continuous_measurement() you have to call this method again before formaldehyde, temperature and humidity values can be retrieved again.

function start_continuous_measurement()

Stop measurement on SFA30 evaluation kit. After calling this function, no more sensor values can be read out anymore until you call start_continuous_measurement

function stop_continuous_measurement()

License

MIT

Copyright (c) 2021, Sensirion AG