/bme680-py

Python library for BME680 sensor

Primary LanguagePythonMIT LicenseMIT

bme680-py

BME680 のデータを Python で読むためのライブラリです。

Requirements

  • Python 3 or MicroPython
  • I2C

Raspberry Pi もしくは Raspberry Pi Pico での利用を想定しています。

Raspberry Pi の I2C は以下のコマンドで有効化できます:

sudo raspi-config
# Interface Options -> I2C で I2C を有効化する

Installation

Python 3

pip install git+https://github.com/ttk1/bme680-py.git

MicroPython (mip)

import mip
mip.install("github:ttk1/bme680-py")

Example Usage

import time
from bme680 import BME680

if __name__ == "__main__":
    device = BME680()
    while True:
        device.measure()
        print(
            "temp: {:0.2f} °C\npress: {:0.2f} hPa\nhum: {:0.2f} %".format(
                device.temp, device.press / 100, device.hum
            )
        )
        time.sleep(3)

免責事項

このツールを使ったことによって生じた結果について、いかなる責任も負いません。 ご使用は自己責任でお願いします。