I2C デバイス
Arduino® ハードウェアに接続された I2C デバイスの読み取りと書き込み
I2C 関数を使用する前に、arduino
を使用して Arduino オブジェクトを作成します。詳細については、Connect to Arduino Hardwareを参照してください。Arduino エクスプローラー アプリを使用して I2C 通信インターフェイスを構成し、そのインターフェイスを使用して Arduino ハードウェアに接続された I2C デバイスに対してデータの読み取りと書き込みを行うこともできます。
メモ
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 register |
トピック
- 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.