mirror of
https://github.com/sipeed/sipeed_wiki.git
synced 2026-09-15 06:58:26 -05:00
Update I2C_1.md
This commit is contained in:
@@ -10,8 +10,6 @@ desc: maixpy3 doc: I2C
|
||||
|
||||

|
||||
|
||||
> 以下代码由于 MaixPy3 还在优化中,可能不能运行,具体的代码到 [github](https://github.com/sipeed/MaixPy3) 上查看
|
||||
|
||||
```python
|
||||
from maix import i2c
|
||||
i2c_address = i2c.I2CSecan('/dev/i2c-2') # 获取设备在 I2C 的地址数据
|
||||
@@ -21,9 +19,7 @@ i2c_ID = i2c.read_register(i2c_address, 0x36, 4) # 读取设备寄存器上
|
||||
i2c.writes(i2c_address, 1) # 对设备上发送数据
|
||||
i2c.writes_register(i2c_address, 0x38, 0xab) # 对设备上的寄存器写入数据
|
||||
```
|
||||
> 以上是 MaixII-Dock 开发板的板载三轴加速度传感器部分代码,完整代码在 [Github](https://github.com/sipeed/MaixPy3/blob/master/examples/maix_v831/usage/usage_v831_i2c-2.py)
|
||||
|
||||
对于 I2C 别的使用方法,可以查看 MaixPy3 在 Github 上的源码
|
||||
> 以上是 MaixII-Dock 开发板的板载三轴加速度传感器部分代码,完整代码在 [Github](https://github.com/sipeed/MaixPy3/blob/release/tests/maix_v831/usage_v831_i2c-2.py)
|
||||
|
||||
## 什么是 I2C 总线
|
||||
|
||||
|
||||
Reference in New Issue
Block a user