-
Notifications
You must be signed in to change notification settings - Fork 47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Migrate from Wire library #18
Comments
Well, we have three different levels: The Adafruit Library and the underlaying wire Library and last but not least the i2c communication of the sensor. So, debugging means understanding all three of those levels. I had very quick look at the Adafruit Library and the spec of the bosch sensor and then your modified parts. It's hard to tell what is going wrong, especially since I don't have the sensor, so I cannot check i2c timings with the scope. |
Hmmm, without the i2c device it is hard to tell where the problem is... The only thing I could think of: According to the datasheet, section 6.2.1 the i2c master should send: START, Slave address, register address, register data, STOP. Now, in your code you are writing register and register data seperately, i.e. with two I would do |
Thank you for your answer, |
@jlohmoeller : I've added a wiki section on "How to migrate from Wire Library", see here |
I am failing to get this library working with a BME280 Environment Sensor.
I moved from the Arduino Wire library to brzo_i2c since the AMS iAQ-Core air quality sensor did not work correctly with the builtin Wire lib.
I took the code from Adafruit and changed the parts handling I2C communication.
Original Code:
My adapted version: (except leaving out the SPI stuff and
Wire.begin()
the rest of the code has not changed)I get the following output when requesting the registers holding measured data:
For me it seems like reading works, but the BME280 does not measure and hence does not fill its registers with correct values. According to the datasheet
800000
is the default value. Writing (1) should force measurement and after this the registers should be filled with data. I guess there is something wrong in thewrite8(...)
method.If I change back to wire (by copy-pasting the methods shown above), the BME280 works fine (so there is no hardware fault)...
Maybe an example in the Wiki comparing Arduinos Wire-lib and brzo_i2c would be helpful :)
The text was updated successfully, but these errors were encountered: