Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

pyserial example code

>>> 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
Source by pyserial.readthedocs.io #
 
PREVIOUS NEXT
Tagged: #pyserial #code
ADD COMMENT
Topic
Name
7+4 =