update example to match docs

patch/bme68x-configure-fix
Hel Gibbons 2023-01-10 14:29:02 +00:00
rodzic 1e1d8bf4f5
commit 45014853e6
1 zmienionych plików z 3 dodań i 3 usunięć

Wyświetl plik

@ -11,12 +11,12 @@ PINS_PICO_EXPLORER = {"sda": 20, "scl": 21}
i2c = PimoroniI2C(**PINS_BREAKOUT_GARDEN)
bmp = BreakoutBME68X(i2c)
bme = BreakoutBME68X(i2c)
# If this gives an error, try the alternative address
# bmp = BreakoutBME68X(i2c, 0x77)
# bme = BreakoutBME68X(i2c, 0x77)
while True:
temperature, pressure, humidity, gas, status, _, _ = bmp.read()
temperature, pressure, humidity, gas, status, _, _ = bme.read()
heater = "Stable" if status & STATUS_HEATER_STABLE else "Unstable"
print("{:0.2f}c, {:0.2f}Pa, {:0.2f}%, {:0.2f} Ohms, Heater: {}".format(
temperature, pressure, humidity, gas, heater))