Add changeable i2c address to BME280 usermod#3966
Merged
Conversation
f597d0f to
d4ba0ba
Compare
d4ba0ba to
32f875d
Compare
32f875d to
43d024f
Compare
Contributor
|
Please do not force push changes. |
blazoncek
suggested changes
May 11, 2024
Contributor
blazoncek
left a comment
There was a problem hiding this comment.
I'm not happy with how sensor is initialised.
Contributor
Author
|
@blazoncek i just remembered. Am I not right in thinking the settings instance is not needed as a separate field? To update it, I have to use setSettings() which means a copy is made in the bme instance. So having a copy of the settings in this class is just double the data. So I can remove the field with settings and create the settings every time I need it instead. Yes? :) |
Contributor
|
According to the library documentation that may be sufficient. |
Contributor
Author
|
Seems to work as well. |
blazoncek
approved these changes
May 14, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The BME280 usermod assumes an address of 0x76 which is incorrect for the BMP280 chip, which defaults to 0x77. This change puts the i2c address into the config and defaults to 0x76.
Notes:
This builds on Fix missing conversions of bme280 values #3965. I'll rebase when that's merged.As of right now, WLED must be rebooted for the address change to take effect. I'm not much of a C++ developer to know the ins and outs of reinitializing theBME280I2Cinstance .. do I stop it? delete it? .. If that was fixed, rebooting wasn't necessary.New config view. The
I2CAddressis new - here set to 0x77.