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