回滚修改,详见ReadMe

This commit is contained in:
ranchuan
2023-07-20 18:00:29 +08:00
parent 688e942b1a
commit 2a3b31c226
14 changed files with 4527 additions and 34 deletions

View File

@@ -458,7 +458,7 @@ if __name__ == "__main__":
# 设置电阻 矫正值
# u.cmd=0x41
# data=bytearray([1,50,0x00,2,51,0x00,3,52,0x00,4,53,0x00,5,54,0x00,6,55,0x00,7,56,0x00,8,57,0x00,9,58,0x00,10,59,0x00,11,60,0x00,12,61,0x00,13,62,0x00,14,63,0x00,15,64,0x00,16,65,0x00,17,66,0x00,18,67,0x00,19,68,0x00,20,69,0x00])
# data=bytearray([1,50,0x00,2,0,0x00,3,0,0x00,4,0,0x00,5,0,0x00,6,0,0x00,7,0,0x00,8,0,0x00,9,0,0x00,10,0,0x00,11,0,0x00,12,0,0x00,13,0,0x00,14,0,0x00,15,0,0x00,16,0,0x00,17,0,0x00,18,0,0x00,19,0,0x00,20,0,0x00])
# 测量电阻
# u.cmd=0x42
# data=bytearray([0])
@@ -466,12 +466,12 @@ if __name__ == "__main__":
# u.cmd=0x43
# data=bytearray([1,50,0x00,2,51,0x00,3,52,0x00,4,53,0x00,5,54,0x00,6,55,0x00,7,56,0x00,8,57,0x00,9,58,0x00,10,59,0x00,11,60,0x00,12,61,0x00,13,62,0x00,14,63,0x00,15,64,0x00,16,65,0x00,17,66,0x00,18,67,0x00,19,68,0x00,20,69,0x00])
# 设置电机校正值
u.cmd=0x40
# u.cmd=0x40
# data=bytearray([0x01,100,0])
# data=bytearray([0x02]) # 上升
data=bytearray([0x03]) # 下降
# data=bytearray([0x03]) # 下降
print(u.encode(data).hex(' '))
# print(u.encode(data).hex(' '))
# with open("file/EX_Coder_Test_2023-07-6.json","rb") as f:
# json_obj=json.loads(f.read())
# d=scheme_to_byte(json_obj)
@@ -482,6 +482,11 @@ if __name__ == "__main__":
# s="{d:03d}".format(d=2)
# print(s)
with open("file/7-15.json","rb") as f:
u.cmd=0x22
p=u.encode(f.read())
print(p.hex(' '))
# 开始检测
# 59 6d 03 00 30 00 00 60 0f