Hello To get the sensor data correct, the following shoud be checked 1) i2c read/write should work as expected, the BME680 API uses burst read and burst write 2) sensor HW is configured properly (essentially correct values are written to registers, also make sure delays are respected otherwise this could abuse the sensor and something may stop working), that's why a delay_ms function needs to be supplied to the BME680 API It looks your I2C read / write are working, and let's assume this is the case.Then the next step is to make sure the sensor is configured properly, and this is best done by calling the APIs because all the requirements/specs are taken into account by the APIs and they are verified, when working with HW like sensors, one common issue is that some bit might have been missed and the HW doesn't work as expected and when you find it out, it turns on like a magic. Since you have implemented the i2c_read and i2c_write, you just need to implement a delay_ms and feed those callbacks to the API, and all the detailed configurations are taken care of automatically, see details at: https://github.com/BoschSensortec/BME680_driver/blob/master/README.md a lot of the code could be copied and pasted to your project and simply works, all you need to focus on is to make sure: the read(), write(), and delay_ms() are working as expected per the API requirment. if that still doesn't help, a much more tedious way is to: dump all the registers from the sensor, and check line by line which register does not have expected value. hopefully this helps.
... View more