ceda-demo/script/sendpacket.py

17 lines
253 B
Python
Raw Normal View History

2023-10-16 20:13:55 +00:00
#!/usr/bin/python3
import serial
import time
import sys
ser = serial.Serial('/dev/ttyUSB0', 9600)
while True:
c = sys.stdin.buffer.read(1)
if len(c) == 0:
break
ser.write(c)
# sys.stdout.buffer.write(c)
time.sleep(0.001)