Files
P1-fopper/Util/ioUtil.py
T

22 lines
444 B
Python

from time import sleep
import serial
INPUT_PORT = '/dev/ttyUSB0'
OUTPUT_PORT = '/dev/ttyUSB0'
dataInput = serial.Serial(INPUT_PORT, 115200, timeout=1)
dataOutput = serial.Serial(OUTPUT_PORT, 115200, timeout=1)
def lees():
while True:
line = dataInput.readline()
print(line)
def verzend(telegram):
while True:
for line in telegram:
print(line)
dataOutput.write(line)
sleep(1)