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?
Set I2C pins used by Wire.h?
Re: Set I2C pins used by Wire.h?
You can pass extra arguments to Wire.begin:
https://github.com/espressif/arduino-es ... Wire.h#L55
https://github.com/espressif/arduino-es ... pp#L49-L63
https://github.com/espressif/arduino-es ... Wire.h#L55
https://github.com/espressif/arduino-es ... pp#L49-L63
Re: Set I2C pins used by Wire.h?
Perfect, that worked!
Re: Set I2C pins used by Wire.h?
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 46 guests