-
Notifications
You must be signed in to change notification settings - Fork 7.6k
Add setPins to Wire instead of overloading begin() in a breaking manner #3779
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
Comments
@ladyada A simple answer for this problem, call Chuck. |
@stickbreaker hi, thanks for the response. that is the exact thing we will not do because official Arduino code style has Wire.begin() in sensor/device begin() :) https://www.arduino.cc/en/Reference/WireBegin ESP changed the Wire prototype so that it is different from every other Arduino platform. We are asking that this not be done and an alternative way to set pins is defined |
@ladyada So, you want code like this? void setup(){
#ifdef ARDUINO_ARCH_ESP32
Wire.setpins(sda,scl);
#endif
Wire.begin();
} Chuck. |
yeah that would best! also, capitalize P in setPins() to match arduino style :) |
If you can use the void setup(){
#ifdef ARDUINO_ARCH_ESP32
Wire.begin(sda,scl);
#endif
Wire.begin(); //redundant, but won't cause any problems.
} Chuck. |
hi, not if the code is inside existing written libraries. they need to be able to call setPins before the sensor begin
|
@ladyada Is this why the OLED feather displays garbage on ESP32 but same code works on a Wiced Feather? |
@Andrewiski probably not - if you need tech support please post in the adafruit forums :) |
@stickbreaker hi hi, checkin' in - do you have any other questions on this issue? :) |
[STALE_SET] This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. Thank you for your contributions. |
@me-no-dev can y'all assign someone else who is interested in this issue? @stickbreaker has not replied in ~2 months. |
[STALE_CLR] This issue has been removed from the stale queue. Please ensure activity to keep it openin the future. |
[STALE_SET] This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. Thank you for your contributions. |
@me-no-dev can y'all assign someone else who is interested in this issue? @stickbreaker has not replied in ~4 months |
[STALE_CLR] This issue has been removed from the stale queue. Please ensure activity to keep it openin the future. |
@ladyada yup. Let me see what I can do. I have no heard from Chuck if a few as well. |
yes! right now we get weekly requests to have special code for ESP since they want to run |
cool! Will do! |
thankyouthankyouthankyou it will be incredibly helpful and let many more ESP customers use our libraries! |
done :) |
yaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaay this is awesome! thank you! |
@ladyada please do email me if you see that there is no response. Things do get buried sometimes for various reasons :) |
Wow! I was just looking at how to use 9960 on a wemos esp32 board! Thank you @ladyada and @me-no-dev! It's so great to start a dev project and then see github comments from days ago that may solve your problem! |
hi folks - we get about 1 request every week or so for us to change our libraries so people can pass I2C pin numbers into Wire.begin()
We can't merge these PRs because official Arduino code style has
Wire.begin()
in sensor/devicebegin()
:https://github.com/arduino-libraries/Arduino_LSM6DS3/blob/master/src/LSM6DS3.cpp#L76
please add a
Wire.setPins()
or similar function that can be called at the beginning of the sketch, instead of breaking compatibility by changing the prototype of Wire.begin() - it will make both library developers and users much happier!see:
The text was updated successfully, but these errors were encountered: