From 1e1d8bf4f53ada493d42984451d61c59df34ac38 Mon Sep 17 00:00:00 2001 From: Hel Gibbons <50950368+helgibbons@users.noreply.github.com> Date: Mon, 9 Jan 2023 15:07:06 +0000 Subject: [PATCH 1/2] Fix bme68x configure --- micropython/modules/breakout_bme68x/breakout_bme68x.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/micropython/modules/breakout_bme68x/breakout_bme68x.c b/micropython/modules/breakout_bme68x/breakout_bme68x.c index 2090c572..2f6bc0f6 100644 --- a/micropython/modules/breakout_bme68x/breakout_bme68x.c +++ b/micropython/modules/breakout_bme68x/breakout_bme68x.c @@ -11,6 +11,7 @@ MP_DEFINE_CONST_FUN_OBJ_KW(BreakoutBME68X_configure_obj, 1, BreakoutBME68X_confi /***** Binding of Methods *****/ STATIC const mp_rom_map_elem_t BreakoutBME68X_locals_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_read), MP_ROM_PTR(&BreakoutBME68X_read_obj) }, + { MP_ROM_QSTR(MP_QSTR_configure), MP_ROM_PTR(&BreakoutBME68X_configure_obj) }, }; STATIC MP_DEFINE_CONST_DICT(BreakoutBME68X_locals_dict, BreakoutBME68X_locals_dict_table); @@ -86,4 +87,4 @@ MP_REGISTER_MODULE(MP_QSTR_breakout_bme68x, breakout_bme68x_user_cmodule, MODULE MP_REGISTER_MODULE(MP_QSTR_breakout_bme68x, breakout_bme68x_user_cmodule); #endif //////////////////////////////////////////////////////////////////////////////////////////////////// -//////////////////////////////////////////////////////////////////////////////////////////////////// \ No newline at end of file +//////////////////////////////////////////////////////////////////////////////////////////////////// From 45014853e642452e5f337750dcfd4b300518a61b Mon Sep 17 00:00:00 2001 From: Hel Gibbons Date: Tue, 10 Jan 2023 14:29:02 +0000 Subject: [PATCH 2/2] update example to match docs --- micropython/examples/breakout_bme68x/bme68x_demo.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/micropython/examples/breakout_bme68x/bme68x_demo.py b/micropython/examples/breakout_bme68x/bme68x_demo.py index 64f09b08..acae036e 100644 --- a/micropython/examples/breakout_bme68x/bme68x_demo.py +++ b/micropython/examples/breakout_bme68x/bme68x_demo.py @@ -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))