Skip to content

Commit f61ac69

Browse files
author
zhen.guo
committed
I2C 数据改为 list
1 parent 8e41632 commit f61ac69

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

en-us/api/QuecPythonClasslib.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6255,9 +6255,9 @@ i2c_log = log.getLogger("I2C")
62556255
if __name__ == '__main__':
62566256
I2C_SLAVE_ADDR = 0x1B # i2c device addrress
62576257
# i2c register address, passed in as buff, take the first value and calculate the length of a value.
6258-
WHO_AM_I = bytearray({0x02, 0})
6258+
WHO_AM_I = bytearray([0x02, 0])
62596259

6260-
data = bytearray({0x12, 0}) # Enter the corresponding command
6260+
data = bytearray([0x12, 0]) # Enter the corresponding command
62616261
i2c_obj = I2C(I2C.I2C0, I2C.STANDARD_MODE) # Return i2c object
62626262
i2c_obj.write(I2C_SLAVE_ADDR, WHO_AM_I, 1, data, 2) # Write data
62636263

zh-cn/api/QuecPythonClasslib.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6703,9 +6703,9 @@ i2c_log = log.getLogger("I2C")
67036703

67046704
if __name__ == '__main__':
67056705
I2C_SLAVE_ADDR = 0x1B # i2c 设备地址
6706-
WHO_AM_I = bytearray({0x02, 0}) # i2c 寄存器地址,以buff的方式传入,取第一个值,计算一个值的长度
6706+
WHO_AM_I = bytearray([0x02, 0]) # i2c 寄存器地址,以buff的方式传入,取第一个值,计算一个值的长度
67076707

6708-
data = bytearray({0x12, 0}) # 输入对应指令
6708+
data = bytearray([0x12, 0]) # 输入对应指令
67096709
i2c_obj = I2C(I2C.I2C0, I2C.STANDARD_MODE) # 返回i2c对象
67106710
i2c_obj.write(I2C_SLAVE_ADDR, WHO_AM_I, 1, data, 2) # 写入data
67116711

0 commit comments

Comments
 (0)