I would like to know how I reuse my I2C or SPI pins on the ESP32 board with another component if an existing component is already using one of them?
I think the most important question here is how do I use the I2C pins or the SPI pins if already equiped by other components??
You can set more than one I2C bus with the ESP32 by using the Wire library. See this discussion where they explain how to use two I2C bus simultaneously: https://github.com/espressif/arduino-esp32/issues/977
You can also set more than one SPI connection. For example, if you’re using several sensors that work via SPI, normally you can define the SPI pins when instantiating the library. So, you just need to pass wherever SPI pins you choose to the initialization.
With the ESP32 almost any pin can be set as SPI or I2C.
I hope this helps.
Let me know if you need further help.