Skip to content
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

twowire i2c library don't work with multiple instance #7894

Open
6leonardo opened this issue Feb 26, 2021 · 1 comment
Open

twowire i2c library don't work with multiple instance #7894

6leonardo opened this issue Feb 26, 2021 · 1 comment

Comments

@6leonardo
Copy link

6leonardo commented Feb 26, 2021

Two wire for i2c not support multi instances...

If you create multiple instance of twowire only the last one work

Originally posted by @devyte in #3063 (comment)

@6leonardo 6leonardo changed the title Please open a new issue, follow the template instructions, explain the problem with the addresses, and reference this issue. twowire i2c library nor work with multiple instance Feb 26, 2021
@6leonardo
Copy link
Author

6leonardo commented Feb 26, 2021

The problem is that twowire use internally a static class twi..so you can create many instance of twowire but there is only one twi....

I do same changes and Now it works....it's not very beautiful code but seams to work...
I have tested with 4 gy-bme280... 2 for bus
here the patch in cores/esp8266 I
and in the library Wire
you can put the wire library in local library but for the core I must change the original files
mod_i2c_multi-bus.zip
I attach the code for test the 4 gy-bme280
gy-bme280.ino.zip

All it's started here
......

Originally posted by @6leonardo in #3063 (comment)

@6leonardo 6leonardo changed the title twowire i2c library nor work with multiple instance twowire i2c library not work with multiple instance Feb 26, 2021
@6leonardo 6leonardo changed the title twowire i2c library not work with multiple instance twowire i2c library don't work with multiple instance Feb 26, 2021
@devyte devyte self-assigned this Mar 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants