Simple test¶
Ensure your device works with this simple test.
examples/extended_bus_simpletest.py¶
1"""
2This exmaple demonstrates how to instantiate the
3Adafruit BME280 Sensor using this library and just
4the I2C bus number.
5"""
6
7import adafruit_bme280
8from adafruit_extended_bus import ExtendedI2C as I2C
9
10# Create library object using our Extended Bus I2C port
11i2c = I2C(1) # Device is /dev/i2c-1
12bme280 = adafruit_bme280.Adafruit_BME280_I2C(i2c)
13print(f"\nTemperature: {bme280.temperature:0.1f} C")