
ESP32’s I2C controller operating as master is responsible for establishing communication with I2C slave devices and sending commands to trigger a slave to action, for example, to take a measurement and send the readings back to the master.

Esp32 arduino i2c example how to#
In the following example, I will show how to use multiple I2C buses of ESP32 using Espressif core for Arduino. Not only you can have more devices of the same type and avoid I2C address conflicts, but you can also take full advantage of 2 ESP32 cores and communicate with multiple devices at the same time. To achieve this I have made a voltage divider circuit using one 10k resistors and one 20k resistor. To establish a proper communication channel between the two it is required to bring the voltage of Arduino board to 3.3V. Here comes the advantage of having multiple I2C buses. Challenge over here is that our ESP32 board works on 3.3V whereas Arduino Uno works on 5V.

The issue that I am facing is that for some reason there is a big delay between consecutive I2C transfers (write only) that is causing very poor refresh rate.

Esp32 arduino i2c example driver#
I’m interfacing an LED matrix using a matrix driver that communicates over I2C. If the bus is used by, for example, MPU6050, parallel communication with SSD1306 OLED display is not possible. Hello, I’ve been building a project using PlatformIO and the ESP32 on a custom board. However, one has to remember that one of the devices can be polled at a time. As long as slave device addresses are unique, everything will work just fine: OLED display, LM75 temperature sensor, MPU6050 gyroscope. Yes, the I2C bus allows connecting multiple slave devices to single pair of SCL SDA wires. One of the advantages of the ESP32 microcontrollers over the competitions is dual-core architecture and two I2C buses.
