研究了一晚上的成果。
import serial
import win32com.client
import matplotlib.pyplot as plt
import numpy as np
ser = serial.Serial("COM6", 115200, bytesize = 8,timeout=0.5) # 打开串口
print("我要开始了:")
res=[]
while (1):
ch = ser.readline(1)
result = ''
hLen = len(ch)
for i in range(hLen):
hv
1