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
Add changeable i2c address to BME280 usermod #3966
Add changeable i2c address to BME280 usermod #3966
Conversation
f597d0f
to
d4ba0ba
Compare
d4ba0ba
to
32f875d
Compare
32f875d
to
43d024f
Compare
Please do not force push changes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not happy with how sensor is initialised.
@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? :) |
According to the library documentation that may be sufficient. |
Seems to work as well. |
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 theBME280I2C
instance .. do I stop it? delete it? .. If that was fixed, rebooting wasn't necessary.New config view. The
I2CAddress
is new - here set to 0x77.