📜  pyserial 示例代码 - Python 代码示例

📅  最后修改于: 2022-03-11 14:47:05.281000             🧑  作者: Mango

代码示例1
>>> 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