Repozitář maturitního projektu IVE. Vozítko ovládané přes internet, které sbírá data z modulů.
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.
 
 
 
 
 
 

14 lines
398 B

import serial
ser = serial.Serial('/dev/ttyACM0') # rozhraní na které je micro připojeno
# -> dá se zjistit pomocí "ls /dev"
ser.flushInput()
while True:
try:
ser_bytes = ser.readline()
decoded_bytes = ser_bytes[0:len(ser_bytes)-2].decode("utf-8")
print(decoded_bytes)
except Exception as e:
print(e)
print("Keyboard Interrupt")
break