Page 1 of 1

Set I2C pins used by Wire.h?

Posted: Mon Jun 05, 2017 8:12 pm
by Scalpel78
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?

Re: Set I2C pins used by Wire.h?

Posted: Tue Jun 06, 2017 2:45 am
by ESP_igrr

Re: Set I2C pins used by Wire.h?

Posted: Tue Jun 06, 2017 10:16 pm
by Scalpel78
Perfect, that worked!

Re: Set I2C pins used by Wire.h?

Posted: Tue Oct 17, 2017 12:13 pm
by bhavenm
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.