Revision dd83f4831e2452d0534b914c23080f21c88f46b7 authored by Richard Petri on 20 July 2022, 07:54:20 UTC, committed by Richard Petri on 20 July 2022, 07:55:27 UTC
1 parent 26f810d
Raw File
host_unidirectional.py
#!/usr/bin/env python3
import serial
import sys
import platform

if platform.system() == "Darwin":
    dev = serial.Serial("/dev/tty.usbserial-0001", 38400)
else:
    dev = serial.Serial("/dev/ttyUSB0", 38400)

print("> Returned data:", file=sys.stderr)

while True:
    x = dev.read()
    sys.stdout.buffer.write(x)
    sys.stdout.flush()
back to top