-
Notifications
You must be signed in to change notification settings - Fork 108
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
[TIP] Device not configured - temporary fix. #71
Comments
Thanks for the feedback, I'll look into it when I get some time. |
@claws I don't see anything special here. we could test in the configure() method whether the chip respond to 0x5C address or not. But this does not have an ID register to identify this chip. Line 49 in 38e9f37
this is maybe the fault: we overwrite it: Line 63 in 38e9f37
bool begin(Mode mode = CONTINUOUS_HIGH_RES_MODE, byte addr = BH1750_I2CADDR,
But do we need the address as a parameter for the begin() method? |
If the sensor accepts a changed address we can keep it in the |
The sensor allows an address change while running. |
something like this, but use the addr from the constructor as default parameter: https://www.fluentcpp.com/2018/08/17/dependent-default-parameters/ |
Hi All,
So I've seen people having this issue "device not configured" for me, I know it's not hardware issue because I've been running MicroPython without a problem and the BH1750 sensor is soldered to a custom PCB I've made.
The address in my case is 0x5C I've tried to change it "softly" it didn't work, changed the source files didn't work till I found a fix by looking into one of the advanced examples.
After changing lightMeter.begin() with the following:
lightMeter.begin(BH1750::CONTINUOUS_HIGH_RES_MODE, 0x5C, &Wire);
It fixed my problem, the sensor is working perfectly fine now. I have no idea why as I'm a Python not C or C++ Programmer but would love the author @claws to take a look over it and see if can find the issue.
I've spent about 25 minutes trying to re-solve the problem till I came with this solution, hope it can save some time for others as well that having the same issue as me.
Complete code:
The text was updated successfully, but these errors were encountered: