3.3.4 I2C 使用说明
本文档介绍如何使用 I2C(Inter-Integrated Circuit)通信协议,并通过 Python 的 smbus2 库访问 I2C 外设设备。
I2C 工具准备
执行以下命令克隆 I2C 调试工具代码:
git clone https://gitee.com/cookieee/blue-bridge-cup-hardware.git ~
工具位于 ~/blue-bridge-cup-hardware/dev-tools/i2ctools 目录,包含 i2cdetect、i2cget、i2cset 等调试工具,用于检测与操作 I2C 总线。