-
Notifications
You must be signed in to change notification settings - Fork 187
Allow user to call TwoWire::begin themselves #38
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
Conversation
* That way, they can use non-default pins and have multiple devices on a single TwoWire bus.
882f634
to
a375a24
Compare
To use non-default pins, create a Wire object with those and pass in that instance: Can you clarify what you mean by having multiple devices? That is supported on any I2C bus as long as each device has a unique address. |
Let's say you connect two different sensors on one I2C bus. You are supposed to only call Also, on ESP32 with Arduino framework port, |
you can def call Wire.begin() as many times as you like |
While you definitely can, I don't think you should. As far as I can tell, there are no guards against it anywhere in the Arduino core, so if there is any I2C transfer in progress already, the state will become corrupted. From the code, it's clear I agree that ESP32's begin is "unofficial", but it's also not exactly unpopular platform to build stuff on, and I'd say it's a good idea to at least consider supporting it. |
we support esp32 just fine - but the Wire interface pins must be defined in the BSP like every other arduino :) |
thank you for the PR, but we will not be able to merge it |
I understand, thanks for considering it anyway :)
Honestly, that's horrifying. |
Why constrain the user for one specific configuration when we have a super device as ESP32, where you can set almost each peripheral to any pin. Help us to move to 21. century in MCU development.
Why you couldn't make a small step for improving the Arduino libraries by merging this PR in your library and make Arduino world a little bit better. This will not add you any other workload. |
@JarekParal have you opened an issue with esp32 asking them to make a new, non-conflicting function say |
devices on a single TwoWire bus.