mirror of
https://github.com/cmur2/python-bme680.git
synced 2025-07-06 11:11:26 +02:00
Check for both i2c addresses in examples
This commit is contained in:
@ -8,7 +8,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 calibration data can safely be commented
|
||||
# out, if desired.
|
||||
|
Reference in New Issue
Block a user