Open
Conversation
|
It looks like this code update fixes the issue. I get five individual distance readings now with five sensors, which I confirmed by blocking each sensor individually. Thank you! |
Member
Author
|
Wow. I'm actually a little surprised it hasn't subtly broken. Thanks for reporting back. |
|
No problems, thank you for taking the time to help out 👍 I will be messing with these sensors for the next few weeks, so you'll probably hear more from me on here :) |
2307bd5 to
7b06138
Compare
|
Would love some help on this! I cloned the multiple-i2c-bus-support branch. I also set up two additional physical i2c busses by retagging 4 gpio pins. However i'm still running into issues described - one sensor reading is applied to all three. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is an experimental fix for #33 (I have no hardware to test locally, so I've only tested that this compiles).
It fixes the issue of the i2c read/write and multi functions being global, so that if you attempted to initialise several sensors on different i2c busses then you'd only actually be talking to the last initialised bus, since the read/write/multi function pointers were being overwritten.
This is achieved by moving the i2c IO functions into VL53L1_DEV and passing them in through
_TOF_LIBRARY.initialiseinstead of_TOF_LIBRARY.VL53L1_set_i2c.This should have no impact on existing setups.
It might be worth also moving the i2c mutex into VL53L1_DEV, since it only needs to be per i2c bus.