Skip to content
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

Fix sample to choose between Wire and Wire1 for QTPy usage #54

Merged
merged 3 commits into from
Sep 11, 2024

Conversation

oculartechie
Copy link
Contributor

When attempting to use bme680test.ino, it wasn't evident when using I2C interface that you might need to choose between two different buses. The changes to the sample is to show that this can be chosen in the code and does not require a change in the library.

There should be no limitations to this change. It just relies on not choosing the default specified by the library.

Tested using a QTPy ESP32 and BME688 connected via STEMMA QT

Reference: https://learn.adafruit.com/scanning-i2c-addresses

@caternuson
Copy link
Contributor

@oculartechie Hey, if you're still monitoring this PR, can you please update the example to also still show the original usage:

Adafruit_BME680 bme; // I2C

Maybe just have a commented out line with a code comment:

Adafruit_BME680 bme; // I2C on default Wire bus
// Adafruit_BME680 bme(&Wire1); // I2C on specified bus, ex: Wire1

similar to how the various SPI options are also shown commented out.

Otherwise it looks like explicitly specifying the wire bus is required.

update as requested
@oculartechie
Copy link
Contributor Author

@caternuson updated as suggested

@ladyada
Copy link
Member

ladyada commented Sep 11, 2024

remove the #define WIRE, show the default as bme(&Wire) and show the &Wire1 example as a commented out line.

Update as recommended by @ladyada
@ladyada ladyada merged commit 1703c23 into adafruit:master Sep 11, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants