I2C-Geräte
R2026bErstellen Sie mithilfe von arduino ein Arduino-Objekt, bevor Sie die I2C-Funktionen verwenden. Weitere Informationen dazu finden Sie unter Connect to Arduino Hardware. Zudem können Sie Arduino Explorer verwenden, um die I2C-Kommunikationsschnittstelle interaktiv zu konfigurieren und die Schnittstelle zum Lesen und Schreiben von Daten von und auf I2C-Geräten, die mit Arduino und anderer unterstützter Hardware verbunden sind, in MATLAB® und MATLAB Online™ zu verwenden. Weitere Informationen finden Sie unter Connect to I2C Device Using Arduino Explorer App.
Eine vollständige Liste der unterstützten Hardware der installierten MATLAB-Version finden Sie unter Supported Hardware. Weitere Informationen zu unterstützten Platinen, Workflows und Plattformen, die von MATLAB Online unterstützt werden, finden Sie unter Get Started with MATLAB Online for Arduino.
Hinweis
Alle Funktionen außer scanI2CBus generieren Code mithilfe des MATLAB-Funktionsblocks. Weitere Informationen finden Sie unter Deploy Arduino Functions to Arduino Hardware Using MATLAB Function Block.
Funktionen
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 |
Themen
- 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.