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.