Visual Servoing Platform
version 3.7.0
Loading...
Searching...
No Matches
test-serial-read.py
1
#!/usr/bin/env python
2
3
# This test has to run on a Raspberry Pi connected throw a USB
4
# to serial adapter to a laptop.
5
6
from
__future__
import
print_function
7
8
import
time
9
import
serial
10
11
ser = serial.Serial(
12
port=
'/dev/ttyUSB0'
,
13
baudrate = 9600,
14
timeout=0
15
)
16
17
while
True
:
18
data = ser.read(9)
19
if
len(data) > 0:
20
print(
'Got:'
, len(data),
'data:'
, data)
21
22
time.sleep(0.5)
23
print(
'not blocked'
)
24
25
ser.close()
tutorial
robot
mbot
raspberry
python
test-serial-read.py
Generated by
1.15.0