adafruit / Adafruit_BME680

117 stars 75 forks source link

gas_resistance always returns 0 #13

Closed krish2487 closed 5 years ago

krish2487 commented 5 years ago

Hello,

I have been using your wonderful library for the BME680 and am pretty satisfied with it except for one issue. The gas_resistance class member always returns 0. irrespective of any setting. On the contrary, the readGas() function always returns a gas resistance value even though its the same class member.

I tested it in the same code, just swapping out the function calls.

I am guessing because the BME680_HEAT_STAB_MSK is always returning 0.

if (_gasEnabled) {
    if (data.status & BME680_HEAT_STAB_MSK) {
      //Serial.print("Gas resistance: "); Serial.println(data.gas_resistance);
      gas_resistance = data.gas_resistance;
    } else {
      gas_resistance = 0;
      //Serial.println("Gas reading unstable!");
    }
  }

I am using an ESP32 on Platformio and using the stock default settings as given in the test sketch.

Is anyone else facing this issue or just me?? :-)

Thank you in advance! :-)

ladyada commented 5 years ago

just tested code with good bme680 and it works still - please try with more standard hardware so you aren't debugging ESP32, platformio and your wiring :)