Here, you see it says the address is 0x58, which represents a BME280. That’s rright, but there are several I2C addresses. 0x76 is what comes up when you scan I2C devices, and it’s what the manufacturer says the address is.
I want it to look at 0x76, like it says in the library.
in your code (or whatever the name of the define you altering is) then to check and see if the address is being changed.
There is no need to edit the library anyway - the library provides the facility to specify the address if it is different - as shown in the bme280test example (which I was also looking to do just a few days, hence why I remember). Otherwise, you would have to include the library locally in the libs folder, and omit it from your platformio.inilib_deps since you need to use a modified copy.
// You can also pass in a Wire library object like &Wire2
// status = bme.begin(0x76, &Wire2)
This question generalizes to “working with libraries”. Nothing special about this one, outside this particular example of a library detail needing to be changed.
That won’t work. Look at your own screenshot. You are already creating an status object, and you don’t want or need a second one. You want to change from the default, so use the syntax I gave you from the Adafruit example sketch provided with the library!
A better title would have actually been How to change library defaults or How to use modified versions of libraries. “Good, specific libraries question” is a pretty meaningless and unhelpful thread title. You’re likely to be posting a question in a forum - so what is the question about?
I am writing for posterity, for people like me who haven’t started focusing yet, because we’re not entirely sure what we’re looking at. “Libraries” is going to hit a lot of us exactly the way it’s hit me. This will be easy for that searcher to find, probably searching ‘libraries’ first, and there is a lot of helpful information in the thread…
or ‘How do I use modified versions of libraries?’ would also appear in that search, and be descriptive of the question being asked in the thread. Plus the content of the post is searched also, not just the title! After all, I sure it would be much better if we had threads titled ‘good, vague compiler question’ and ‘bad, unclear class question’ … instead of ‘Compiler complains about loop undefined’ or ‘declaring class results in x error’. Just a thought.