doc文档转pdf;优化运行代码
This commit is contained in:
parent
9874cd49a2
commit
590a57e6f9
Binary file not shown.
@ -16,16 +16,16 @@ print("Hello,World!")
|
||||
|
||||
|
||||
# 打开串口
|
||||
port = "COM7"
|
||||
baud = 9600
|
||||
timeout = 1
|
||||
try:
|
||||
ser = serial.Serial(port=port, baudrate=baud, bytesize=8,parity=serial.PARITY_NONE, stopbits=serial.STOPBITS_ONE, timeout=1)
|
||||
if ser.isOpen():
|
||||
print("Port is open")
|
||||
except:
|
||||
print("请检查串口是否被占用;或者串口出现异常!")
|
||||
exit()
|
||||
def init(port, baudrate, timeout):
|
||||
try:
|
||||
ser = serial.Serial(port=port, baudrate=baudrate, bytesize=8,parity=serial.PARITY_NONE, stopbits=serial.STOPBITS_ONE, timeout=timeout)
|
||||
if ser.isOpen():
|
||||
print("Port is open")
|
||||
except:
|
||||
print("请检查串口是否被占用;或者串口出现异常!")
|
||||
exit()
|
||||
|
||||
return ser
|
||||
|
||||
# crc16 算法
|
||||
def crc16(data: bytes) -> int:
|
||||
@ -56,7 +56,7 @@ sed_msg = sed_msg + sendbytes
|
||||
print("发送帧:",sed_msg)
|
||||
|
||||
|
||||
def run():
|
||||
def run(ser):
|
||||
# 读取和解析串口数据
|
||||
while True:
|
||||
ser.write(bytes(sed_msg))
|
||||
|
||||
Binary file not shown.
BIN
docs/NTA8A01 NTC温度传感器设置协议.pdf
Normal file
BIN
docs/NTA8A01 NTC温度传感器设置协议.pdf
Normal file
Binary file not shown.
Binary file not shown.
BIN
docs/NTA8A01 NTC温度传感器说明书.pdf
Normal file
BIN
docs/NTA8A01 NTC温度传感器说明书.pdf
Normal file
Binary file not shown.
Loading…
Reference in New Issue
Block a user