#------------------------------------------------------------------------------- # Name: Serial_read # Purpose: read from the Serial port # # Author: F.Z. # # Created: 23.10.2020 # Copyright: (c) F.Z. 2020 #------------------------------------------------------------------------------- # Serial libryry for python installieren in windows/linux: pip3 install pyserial import serial #import the serial library com = "/dev/ttyACM0" #COM Port for Linux #com = "COM5" #COM Port for Windows try: ser = serial.Serial(com,115200) # open serial connection on port: com with baud: 115200 print("Connection established\n") except: print("Connection error") while 1: x = ser.readline() #read the serial output from Nucleo print(x) #print the serial output from Nucleo