Skip to content

Add support for Wire library for ESP-01 #13

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

Closed
wants to merge 1 commit into from

Conversation

hibikiledo
Copy link

Problem

When using the library with ESP-01, the current signatures for begin() doesn't allow users to specify SDA and SCL pins. According to Wire library in Arduino core for ESP8266, when calling to Wire.begin(), it defaults to 4(SDA) and 5(SCL) which ESP-01 doesn't expose such pins.

Proposed solution

I create another signature for begin() which allows users to pass in SDA and SCL pin numbers. The pin numbers are passed to Wire.begin(int sda, int scl).

#ifdef ESP8266
    void begin(uint8_t addr, uint8_t sda, uint8_t sdc);
#endif

Tested

The modified library has been tested and proved to be working. I am currently using the modified library to control relays from MCP23017 I/O ports.

@spotlesscoder
Copy link

I need this. Any chance of this getting merged?

@nicocesar
Copy link

Oh man... trying to automate all my pipeline I bumped into this,
Can we just merge this? it works.

@ladyada
Copy link
Member

ladyada commented May 25, 2020

hi we will not merge as this is best fixed by espressif - please comment here to request they add a function to do it
espressif/arduino-esp32#3779

@caternuson
Copy link
Contributor

Closing. See issue linked above.

@caternuson caternuson closed this May 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants