stm32-fmt-code/access_control_python/stm32.py

14 lines
245 B
Python
Raw Normal View History

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