-
Notifications
You must be signed in to change notification settings - Fork 8
Fix I2C address #13
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 I2C address #13
Conversation
|
Hello @jerabaul29 , ISM330DHCXSensor(TwoWire *i2c, ISM330DHCX_I2C_ADD_H); // If SA0 pin is High ISM330DHCXSensor(TwoWire *i2c, ISM330DHCX_I2C_ADD_L); // If SA0 pin is Low Best Regards, |
|
Thank you for the clarification! This makes sense now. So I suppose this is what this excerpt from the datasheet means? :) " I see what you mean - I should just change the 7-bit address and let the logics propagate. Thank you for the clarification. As a side note comments:
Not criticizing or disagreeing with your decision - just trying to make sure nobody else gets "bitten" by this :) (I spent a bit more than a full afternoon on this ^^ ). As a side note (but this starts to diverge out a bit): when I was having the wrong address, I did not get any error code / message - just "valid" return values, + empty / all 0s stuff. I suppose this is because the ISM330DHCX/src/ISM330DHCXSensor.cpp Lines 89 to 106 in 6004a94
and the constructor itself only sets variables. Would there be a way to / what would be the recommended way to check for good communication with the sensor, and get an error message if using the wrong port / address etc? :) |
|
Hello @jerabaul29 , |
|
Implemented; I can close this PR for now then, and we can look at the other PR together :) . About this address thing: maybe I can add a small section to the doc in a separate PR? I can open it and then you decide if you want to include it or not :) . |
Summary
I bumped my head trying to use the ISM330DHCX over I2C with this library.
Upon debugging, it seems like the issue was with the address used in the I2C wrappers - I dont know why there is some extra logics i.e.:
instead of just
which would be what I would expect: the first argument of these I2C functions should just be the I2C address of the slave device.
Validation
Things now work using the ISM330DHCX over I2C.