adafruit / Adafruit_BME280_Library

Arduino Library for BME280 sensors
Other
333 stars 304 forks source link

Made the Wire Bus selectable in setup #26

Closed mjs513 closed 7 years ago

mjs513 commented 7 years ago

Scope of Change: Add the compatibility to select which Wire bus you would like to use with the sensor. For instance: to use specify bme.begin(&Wire) . Or, bme.begin(BME280 Address) which just uses the default Wire. Or bme.begin(BME280 Address, &Wire1) which sets both. If you want to can use Wire2 (Teensy 3.5/3.6 have Wire, Wire1, Wire2 that you can use.

Limitation: The only limitation is that there is no default test if you select a Wire port that is not available.

Test: Ran a test on the Teensy 3.5 with the sensor on Wire1 and worked fine.

Thanks for considering this change Mike

mjs513 commented 7 years ago

Update: Just finished testing on the uno and Mega for begin and begin(&Wire) and on the Due for begin(&Wire1). :)

Had to go digging for the Due and Uno boards. :)

ladyada commented 7 years ago

hiya thanks - if you do others please do not change the examples, they have to work by default to match the guides!

mjs513 commented 7 years ago

Got it. Now I know. Thanks MIke