2021-07-01 14:17:59 +02:00

6 lines
207 B
Python

import serial
ser = serial.Serial('/dev/ttyUSB0') # open serial port
print(ser.name) # check which port was really used
ser.write(b'hello') # write a string
ser.close() # close port