I am working on a senior design project where I am using multiple ESP32's to control multiple devices.
There will be another ESP32 which will serve as the master and control the peripheral ESP32's.
The issue is, I'm using the default I2C pins (21_SDA & 22_SCL) for other tasks (one pin is used in the serial programmer so I avoided using it).
I've decided to use the ESP32's second I2C pins (33_SDA & 32_SCL) for the connection between the slave ESP32's.
Now, I've got the Wire.h I2C library to work when connecting to an Arduino Uno (ESP=Master, Uno=Slave)
There doesn't seem to be an issue with the master because it does not require an address.
The issue is that I want to define the slave pins as 33_SDA and 32_SCL, as well as define an address for multiple slaves.
The issue is that I'm not entirely sure how to redefine the pins and set an address.
Master example: Wire.begin(I2C_SDA, I2C_SCL); //Using alternate I2C pins on ESP32 Master
TwoWire SERVO1 = TwoWire(4);
I've been to a number of sites and the closest example I can find is this one from randomnerdtutorials:
I'm certain there has to be an easier way to do this rather than edit the ESP32 bords file (which I'm not really comfortable doing at my skill level).
Basically, if anyone knows the correct way to implement the Wire.h library to redefine the ESP32's I2C pins AND define a slave address, that would be amazing.
This is my first ever post on Arduino forum.
I normally avoid posting, preferring to read, but I have read everywhere I could think to look and still struggling to figure it out.
Thanks in advance.