https://github.com/mupq/pqm4
Raw File
Tip revision: 5fa22a8fbd920f68c97dfb1a4b660e1f8933101c authored by Richard Petri on 21 January 2024, 18:14:32 UTC
Enable out-of-tree builds
Tip revision: 5fa22a8
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