mirror of
https://github.com/cmur2/python-bme680.git
synced 2024-12-22 12:54:29 +01:00
Check for both i2c addresses in examples
This commit is contained in:
parent
df382a50aa
commit
8dce708fef
@ -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
|
||||
|
@ -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.
|
||||
|
@ -4,7 +4,10 @@ import bme680
|
||||
print("""Display Temperature, Pressure and Humidity with different offsets.
|
||||
""")
|
||||
|
||||
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
|
||||
|
@ -10,7 +10,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
|
||||
|
Loading…
Reference in New Issue
Block a user