Connect to I2C Device Using Arduino Explorer App
R2026bI2C (Inter-Integrated Circuit) is a two-wire serial communication protocol that uses a serial data line (SDA) and a serial clock line (SCL) to exchange data between a controller and one or more peripheral devices. I2C is commonly used to communicate with sensors, EEPROMs, displays, and other peripherals that support addressable register-based communication.
Use the Arduino Explorer app to configure an I2C communication interface and read and write data to I2C devices connected to your Arduino hardware. Before you begin, ensure that your Arduino board is connected and detected in the app. If the board is not already connected, see Set Up and Connect to Arduino and Arduino-compatible Boards Using Arduino Explorer.
Set Up I2C Device
To configure an I2C communication interface on your Arduino board:
Click the I2C icon in the Configure section of the app toolstrip. The Set Up I2C Device window opens.
Select the I2C Bus if your board supports more than one bus.
Specify the I2C Address of the peripheral device you want to communicate with. If you do not know the address of your device, click Scan I2C to scan the I2C bus and detect all available device addresses.
Set the Bit Rate (bits/s) to match the communication speed supported by your device.
Click OK to apply the settings.

After you configure the I2C device, the Pin Explorer displays a row for the I2C communication interface, showing the assigned SDA and SCL pins.

Configure Read and Write for I2C
Use the Pin Configuration panel corresponding to the I2C interface to perform one of these operations.
Read or write

Register read or write

The value you specify in the Precision parameter must match the size of the device register.
Once you set the parameter values (in the read and register read operations), click Read. The Read Value column corresponding to the I2C row in the Pin Explorer pane displays the value as read by the SDA pin or the register address.
Once you set the parameter values (in the write and register write operations), edit the corresponding cell in the Write Value column and enter the value to be written to the SDA pin or the register address.
Perform continuous reading of data.
Select the Read Continuously option and then click Start Reading to continuously read data from the I2C device. The value displayed in Read Value column changes continuously based on the data being read. Click Stop Reading to stop reading the data from the I2C device.

For more information on recording and visualizing data, see Visualize and Record Data from Arduino Pins Using Arduino Explorer App.
See Also
Topics
- Set Up and Connect to Arduino and Arduino-compatible Boards Using Arduino Explorer
- Visualize Pin Diagram Using Arduino Explorer App
- Configure Read and Write for GPIO Pins Using Arduino Explorer App
- Connect to SPI Device Using Arduino Explorer App
- Connect to Serial Device Using Arduino Explorer App
- Visualize and Record Data from Arduino Pins Using Arduino Explorer App
- Generate MATLAB Script
- Customizable Views in the App