1
0
mirror of https://github.com/cmur2/python-bme680.git synced 2026-04-05 14:18:43 +02:00

Check for both i2c addresses in examples

This commit is contained in:
Phil Howard
2018-09-03 11:13:32 +01:00
parent df382a50aa
commit 8dce708fef
4 changed files with 16 additions and 4 deletions

View File

@@ -12,7 +12,10 @@ Press Ctrl+C to exit
""")
sensor = bme680.BME680()
try:
sensor = bme680.BME680(bme680.I2C_ADDR_PRIMARY)
except IOError:
sensor = bme680.BME680(bme680.I2C_ADDR_SECONDARY)
# These oversampling settings can be tweaked to
# change the balance between accuracy and noise in