stm32-fmt-code/access_control_python/test2.py

13 lines
201 B
Python
Raw Normal View History

2023-11-17 15:43:10 +00:00
import serial
ser = serial.Serial('COM13', 115200)
data = b''
while True:
byte = ser.read()
if byte == b'\x03':
break
data += byte
data_str = data.decode('utf-8')
print(data_str)