Repozitář pro studenty 3.ročníku zaměření IVE
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

16 lines
395 B

import serial
#---nastaveni---
PORT = "COM3" #JE POTŘEBA ZMĚNIT PODLE REALNÉHO ESP
BAUDRATE = "115200"
ser = serial.Serial(PORT,BAUDRATE,timeout=2)
print(f"připojeno na {PORT}@{BAUDRATE} baud")
try:
while True:
line = ser.readline().decode("utf-8").strip()
if line:
print(line)
except KeyboardInterrupt:
pass
finally:
ser.close()
print("Odpojeno")