Chat freely about anything...

User avatar
By Gawan
#41402 Hi,
finally I found some code that works.
(5.96 KiB) Downloaded 946 times

Unfortunately it has 2 disadvantages.

1. it is quite low-level and I dont understand everything, e.g. the calibration-functions or why does it write to Wire ??
2. I did not find a possibility so far to do sea level calibration (its 1013.25 here)

Can you - without too much effort - find out why it works and why the other library did not ?
Seems to be something with Wire.h but I do not understand the details :(

BR
Gawan
User avatar
By martinayotte
#41403 Maybe you should try, using this lib, to add a new readChipID() function to see if it still giving wrong ID.
If it still wrong, then, maybe your BME280 is a clone and simply commenting the check in Adafruit lib will be the trick.
Code: Select allint readChipID() {
    Wire.beginTransmission(BME280_ADDRESS);
    Wire.write(0xD0);
    Wire.endTransmission();
    Wire.requestFrom(BME280_ADDRESS,1);
    return Wire.read();
}

and in your sketch :
Code: Select allSerial.print(readChipID());