-
Notifications
You must be signed in to change notification settings - Fork 26
Support non-default I2C masters #33
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
Support non-default I2C masters #33
Conversation
|
Hold off merging this. I just realised this doesn’t work for the hybrid imus. I will move the reference out of base. |
Done |
|
Hello, sorry for the wait but this does not build on IDE 1.8.19, I haven't tested it on 2.x but i don't expect it to build either and so on for pretty much every IMU. |
|
Changing However I don't have anything on hand that has multiple hardware i2c ports to test this with, I tried compiling it with an ESP32 as the board and it seems to take both "Wire" and "Wire1" in the constructor just fine but I don't have one handy to test with |
|
Hi, I tested compilation of all IMUs on 2.3.3. A quick google suggests that the gcc version is the same between versions, so I'm not sure why it's failing. I'm just installing 1.8.9. |
|
Right, my setup was wrong - sorry for the trouble. I'll just check the fix and push it when done. |
|
No worries! |
|
I pushed a fix, I removed the TwoWire reference and constructor out of the IMUBase class so that it remains as a pure interface. This makes sense for the IMU and compass combos and for non-I2C IMUs in future (e.g. SPI). |
|
Looks and runs well now! I'll push an update to the arduino library manager version soon-ish after I do some cleanup |
This PR adds support for non-default I2C masters #30. A TwoWire instance can now be optionally parsed into the contructor, e.g.
Given all currently supported IMUs are I2C devices, I've put the TwoWire reference in I2CBase.