Skip to content

Commit c09370c

Browse files
authored
Merge pull request #99 from guozhenh/main
I2C 数据改为 list
2 parents de640ab + f61ac69 commit c09370c

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
@@ -6316,9 +6316,9 @@ i2c_log = log.getLogger("I2C")
63166316
if __name__ == '__main__':
63176317
I2C_SLAVE_ADDR = 0x1B # i2c device addrress
63186318
# i2c register address, passed in as buff, take the first value and calculate the length of a value.
6319-
WHO_AM_I = bytearray({0x02, 0})
6319+
WHO_AM_I = bytearray([0x02, 0])
63206320

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

zh-cn/api/QuecPythonClasslib.md

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

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

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

0 commit comments

Comments
 (0)