Files
P1-fopper/Telegram/TelegramUtil.py
T
2025-07-23 22:28:03 +02:00

20 lines
399 B
Python

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