7 lines
185 B
Python
7 lines
185 B
Python
# -*- coding: utf-8 -*-
|
|
from serial import Serial
|
|
|
|
with Serial("/dev/ttyUSB0", baudrate=9600, timeout=2) as x:
|
|
x.write(b"Hello, World!")
|
|
print(x.read(13))
|
|
print(x.read(13))
|