espruino / EspruinoDocs

See http://espruino.com for the complete Espruino Documentation - many links in this repository will not work
http://www.espruino.com/
Other
260 stars 284 forks source link

BME680 module issues #443

Closed SpenceKonde closed 6 years ago

SpenceKonde commented 6 years ago

The BME680 module only works if the global object initiated is named bme.

For example:

bme=require("BME680").connectI2C(I2C1);

works, while this:

BME680=require("BME680").connectI2C(I2C1);

does not - reading from it shows:

Uncaught ReferenceError: "bme" is not defined
 at line 1 col 4
bme.set_sensor_mode(a.FORCED_MODE)
   ^
in function "perform_measurement" called from line 3 col 30
  BME680.perform_measurement();
                             ^
in function called from system

Additionally, it appears that something is wrong with the gas resistance measurement - every time a reading is taken, the reported resistance increases by several hundred ohms, despite there being no change in ambient conditions. I watched this happen over 10 minutes or so as it climbed from a few thousand ohms to around 80-thousand. I am not sure exactly what's going on here.

gfwilliams commented 6 years ago

Thanks - just fixed! The difference in gas measurement is to be expected I think - they take quite a while to settle in...

See https://learn.pimoroni.com/tutorial/sandyj/getting-started-with-bme680-breakout and the notes about 'burning in the sensor'