Simple test¶
Ensure your device works with this simple test.
1# SPDX-FileCopyrightText: 2020 Bryan Siepert, written for Adafruit Industries
2# SPDX-License-Identifier: MIT
3from time import sleep
4import board
5from adafruit_ms8607 import MS8607
6
7i2c = board.I2C() # uses board.SCL and board.SDA
8# i2c = board.STEMMA_I2C() # For using the built-in STEMMA QT connector on a microcontroller
9sensor = MS8607(i2c)
10
11while True:
12 print("Pressure: %.2f hPa" % sensor.pressure)
13 print("Temperature: %.2f C" % sensor.temperature)
14 print("Humidity: %.2f %% rH" % sensor.relative_humidity)
15 print("\n------------------------------------------------\n")
16 sleep(1)