some minor suggerstions
holgerlembke opened this issue · 1 comments
holgerlembke commented
- samples should include setting the i2c adress, my bme280-modul needed bme280.settings.I2CAddress = 0x76;
- Wire.begin() should be removed (different plattforms need other begin()-calls)
- result of BME280::begin() should be defined or shown in example (perhaps having it as a true/false if not 0x60 would be a better option but break compatibility)
nseidle commented
YES! I've added a function called
void setI2CAddress(uint8_t i2caddress); //Set the address the library should use to communicate. Use if address jumper is closed (0x76).
This changes the global var settings.I2CAddress so you can change which address the lib communicates with.
YES! I've removed the hard coded Wire.x functions.
bool beginI2C(TwoWire &wirePort = Wire); //Uses Wire as default port and 0x77 as I2C address
You can now pass in the wire port of your choice.
Yes! .beginI2C() returns true/false. In the first example we will show how to test for success.