-
Notifications
You must be signed in to change notification settings - Fork 97
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
Problem in i2c.py opening multiple i2c busses #56
Comments
Hello, Could you please refer to the code here in "beta" branch for i2c.py and try again? Also test with this code in "beta" branch: Thank you |
I know it's been a long time but thanks for the suggestions. I tested the two suggestions and they both work in my case. Any ideas of when that code would be merged with For those interested in getting this package working with multiple i2c buses immediately, as proposed by @nikolozka in #12 , I suggest the following changes in Modify lines 50 and 51: if not Bus.instance:
Bus.instance = smbus.SMBus(bus) To: if not self.instance:
self.instance = smbus.SMBus(bus) To find where |
PR #66 created. Feel free to reject if upcoming changes make this obsolete. |
Thank you for your contribution, it has been merged into the latest code. |
This issue was reported by @nikolozka in Issue #12.
The issue is still in the code and I would like to submit a PR for it, however, I'm trying to understand the reasoning behind this.
Why is
instance
being used as a class attribute? It effectively makes theBus
class a singleton class.Are there any advantages to doing this that I'm missing?
To reproduce this problem:
The text was updated successfully, but these errors were encountered: