I2C デバイス
R2026bI2C 関数を使用する前に、arduino を使用して Arduino オブジェクトを作成します。詳細については、Connect to Arduino Hardwareを参照してください。Arduino エクスプローラーを使用して、I2C 通信インターフェイスを対話的に構成し、そのインターフェイスを使用して、MATLAB® および MATLAB Online™ で Arduino などのサポートされているハードウェアに接続されている I2C デバイスに対するデータの読み取りおよび書き込みを行うことができます。詳細については、Connect to I2C Device Using Arduino Explorer Appを参照してください。
MATLAB のインストール バージョンでサポートされているハードウェアの全リストについては、Supported Hardwareを参照してください。MATLAB Online でサポートされているボード、ワークフロー、およびプラットフォームの詳細については、Get Started with MATLAB Online for Arduinoを参照してください。
メモ
scanI2CBusを除くすべての関数は、MATLAB Function ブロックを使用してコードを生成します。詳細については、Deploy Arduino Functions to Arduino Hardware Using MATLAB Function Blockを参照してください。
関数
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 |
トピック
- 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.