Serial('/dev/ttyS1', 19200, timeout=1) as ser: ... x = ser.read() # read one byte ... s ... It raises an exception if the port is not opened correctly.
確定! 回上一頁