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