From 9579055ca642c3583f26c3dad742ff08655da9ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ebbe=20Ba=C3=9F?= Date: Fri, 12 Aug 2022 02:15:58 +0200 Subject: [PATCH] added client and reqs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Ebbe Baß --- pc-client/main.py | 18 ++++++++++++++++++ requirements.txt | 1 + 2 files changed, 19 insertions(+) create mode 100644 requirements.txt diff --git a/pc-client/main.py b/pc-client/main.py index e69de29..345f7fb 100644 --- a/pc-client/main.py +++ b/pc-client/main.py @@ -0,0 +1,18 @@ +import time +import os +current_path = os.path.dirname(os.path.realpath(__file__)) +try: + import serial +except ImportError: + try: + os.system("pip install pyserial") + import serial + except ImportError: + print("Please execute'pip install -r requirements.txt'") + exit() + +host = serial.Serial('COM3', 9600) + +while True: + output = host.readline() + print(output) \ No newline at end of file diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..d0dfd58 --- /dev/null +++ b/requirements.txt @@ -0,0 +1 @@ +pyserial==3.5