24 lines
508 B
Python
24 lines
508 B
Python
import time
|
|
import os
|
|
current_path = os.path.dirname(os.path.realpath(__file__))
|
|
import threading
|
|
try:
|
|
import pystray
|
|
from PIL import Image, ImageDraw
|
|
import serial
|
|
except ImportError:
|
|
print("Please execute 'pip install -r requirements.txt'")
|
|
exit()
|
|
|
|
host = serial.Serial('COM3', 9600)
|
|
|
|
while True:
|
|
try:
|
|
output = host.readline()
|
|
output = output.decode("ASCII")
|
|
output = output.strip()
|
|
print(output)
|
|
|
|
|
|
except KeyboardInterrupt:
|
|
break |