VersBinarii / bme280-rs

A platform agnostic Rust driver for the Bosch BM[PE]-280
Other
59 stars 73 forks source link

I2C address inconsistency #3

Closed ryankurte closed 4 years ago

ryankurte commented 4 years ago

hey thanks for making a neat library!

i notice in the docs the primary address is listed as 0x77 with secondary as 0x78, whereas afaik in the datasheet this should be 0x77 and 0x76, and in the constants primary is set to 0x76 and secondary is set to 0x77 which is inconsistent with the documentation.

i was a bit bamboozled until i manually set the address. can open a PR but i’m not sure which way around you’d prefer to fix this?

sbruton commented 4 years ago

Thanks for catching the inconsistency and for opening an issue!

From the datasheet (page 32):

Connecting SDO to GND results in slave address 1110110 (0x76);
connection it to VDDIO results in slave address 1110111 (0x77)...

So it looks like, according to the datasheet, the code is correct and the inline documentation is wrong. Since I've had no trouble with this library in practice, I think it's safe to update the docs. I'll open a PR for this in a moment and bump the version on crates.io.

Thanks again!

sbruton commented 4 years ago

crates.io updated with version 0.1.2, thanks again @ryankurte