Home

Awesome

README

This is a fork from https://bitbucket.org/oscarBravo/wipy_bme280 which ports the library to the new machine module.

This is a driver for the Bosch BME280 temperature/pressure/humidity sensor, for use with MicroPython-based boards.

About the BME280

The Bosch BME280 Environmental Sensor is a combined temperature, pressure and humidity sensor. It can communicate via I2C or SPI; this driver uses I2C.

See the datasheet at https://www.adafruit.com/datasheets/BST-BME280_DS001-10.pdf for details.

Using the library

Use ftp to copy bme280.py to the flash or flash/lib directory on the board. Then:

import machine
import bme280

i2c = machine.I2C("X")
bme = bme280.BME280(i2c=i2c)

print(bme.temperature(), bme.pressure(), bme.humidity())

Detailed usage

The temperature, pressure and humidity functions are convenience functions that provide human-readable string values to quickly check that the sensor is working. In practice, the methods to use are: