Set I2C pins used by Wire.h?
Posted: 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?
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?