I2C Devices
Create an Arduino object using arduino
before you use I2C
functions. See Connect to Arduino Hardware for more information. You can also use Arduino Explorer app to configure the I2C communication
interface and use the interface to read and write data to I2C devices
connected to the Arduino hardware.
Note
All functions, except scanI2CBus
, can be used to 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 (Since R2019a) |
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 register |
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.