Set I2C pins used by Wire.h?

Scalpel78
Posts: 51
Joined: Sun Feb 26, 2017 7:31 am

Set I2C pins used by Wire.h?

Postby Scalpel78 » Mon Jun 05, 2017 8:12 pm

Hi,
I've been programming with C++/ESP-IDF a while now, but want to switch my project over to use Arduino IDE instead.

During the initial Arduino tests I've come across an issue with I2C, and then I realize that I haven't told the Arduino sketch which of the ESP32 pins I'm using for I2C. In the normal Arduino world the pins are hardcoded, and you don't need to set them - but how does that work in the ESP32 world?

How can I tell my Arduino sketch to use GPIO32 for SCL, and GPIO33 for SDA?

ESP_igrr
Posts: 2072
Joined: Tue Dec 01, 2015 8:37 am

Re: Set I2C pins used by Wire.h?

Postby ESP_igrr » Tue Jun 06, 2017 2:45 am


Scalpel78
Posts: 51
Joined: Sun Feb 26, 2017 7:31 am

Re: Set I2C pins used by Wire.h?

Postby Scalpel78 » Tue Jun 06, 2017 10:16 pm

Perfect, that worked!

bhavenm
Posts: 4
Joined: Sun Oct 08, 2017 5:03 pm

Re: Set I2C pins used by Wire.h?

Postby bhavenm » Tue Oct 17, 2017 12:13 pm

I was wondering if you have an example for this function to be used in the code. New to Arduino and ESP32. Grateful to receive any help here.

Who is online

Users browsing this forum: No registered users and 37 guests