doorstroom functie voor gemak

This commit is contained in:
Juul
2025-08-25 20:20:52 +02:00
parent 90ab29a064
commit 95454b069d
2 changed files with 9 additions and 4 deletions
+7 -2
View File
@@ -2,7 +2,7 @@ from time import sleep
import serial
INPUT_PORT = '/dev/ttyUSB0'
INPUT_PORT = '/dev/ttyUSB1'
OUTPUT_PORT = '/dev/ttyUSB0'
serialInput = serial.Serial(INPUT_PORT, 115200, timeout=1)
@@ -16,4 +16,9 @@ def lees():
def verzend(telegram):
serialOutput.write(telegram.__str__().encode('ascii'))
print(telegram)
sleep(1)
sleep(1)
def doorstroom():
line = serialInput.readline()
serialOutput.write(line)
print(line)
+2 -2
View File
@@ -1,8 +1,8 @@
from Telegram.Telegram import Telegram
from Telegram.TelegramData import TelegramData
from Telegram.TelegramUtil import verzend
from Telegram.TelegramUtil import verzend, doorstroom
if __name__ == '__main__':
telegram = Telegram()
while True:
verzend(telegram)
doorstroom()