Skip to content

Commit

Permalink
Merge pull request #625 from pimoroni/patch/bme68x-configure-fix
Browse files Browse the repository at this point in the history
Fix BME68x configure function
  • Loading branch information
Gadgetoid authored Jan 16, 2023
2 parents c98d0da + 4501485 commit 63fc338
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
6 changes: 3 additions & 3 deletions micropython/examples/breakout_bme68x/bme68x_demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@

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))
Expand Down
3 changes: 2 additions & 1 deletion micropython/modules/breakout_bme68x/breakout_bme68x.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -95,4 +96,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
////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////

0 comments on commit 63fc338

Please sign in to comment.