I2C Devices
R2026bCreate an Arduino object using arduino before you use I2C
functions. See Connect to Arduino Hardware for more information. You can use Arduino
Explorer to interactively configure the I2C communication interface
and use the interface to read and write data to I2C devices connected to
Arduino and other supported hardware in MATLAB® and MATLAB
Online™. For more information, see Connect to I2C Device Using Arduino Explorer App.
For a complete list of hardware supported in the installed version of MATLAB, see Supported Hardware. For more information regarding supported boards, workflows, and platforms supported on MATLAB Online, see Get Started with MATLAB Online for Arduino.
Note
All functions, except scanI2CBus, generate code
using the MATLAB Function block. For more details, see Deploy Arduino Functions to Arduino Hardware Using MATLAB Function Block.
Functions
device | Connection to device on I2C bus on Arduino or ESP32 hardware |
scanI2CBus | Scan I2C bus on Arduino hardware for device address |
read | Read data from I2C bus |
write | Write data to I2C bus |
readRegister | Read data from I2C device register |
writeRegister | Write data to I2C device registers |
Topics
- Communicate with an I2C EEPROM Device
Learn how to store and retrieve data from an I2C EEPROM device.
- Measure Temperature from I2C Device on Arduino Hardware
Learn how to measure temperature from an I2C device on your Arduino hardware.
- Arduino I2C Interface
Learn how Arduino hardware interfaces with the I2C protocol.
- Use Arduino Explorer App
Learn how to use the Arduino Explorer app to configure GPIO pins and communication protocol interfaces and visualize data.
- Connect to I2C Device Using Arduino Explorer App
I2C (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.