From f7092b6fc439f632c0b8b50b6b94b41e20584732 Mon Sep 17 00:00:00 2001 From: ym13n22 <ym13n22@soton.ac.uk> Date: Sun, 11 Aug 2024 20:37:57 +0100 Subject: [PATCH] first version done, no hardware combination,thread need to fix --- integration/Window.py | 16 +++++++++++----- integration/trained-copy2.txt | 2 ++ 2 files changed, 13 insertions(+), 5 deletions(-) create mode 100644 integration/trained-copy2.txt diff --git a/integration/Window.py b/integration/Window.py index 3d78ccd..0a25044 100644 --- a/integration/Window.py +++ b/integration/Window.py @@ -658,14 +658,14 @@ class trainingInterface: def EMG_connect_HandOpen(self): self.arduino_EMG = serial.Serial('COM5', 9600, timeout=1) gesture = "handOpen" - self.start_countdown(11) + self.start_countdown(5) self.displayAndsaveDate() def handCloseButton(self): self.arduino_EMG = serial.Serial('COM5', 9600, timeout=1) gesture = "handOpen" - self.start_countdown_close(11) + self.start_countdown_close(5) self.displayAndsaveDate() @@ -877,7 +877,7 @@ class Algorithm: class gameScreen: def __init__(self, root): self.root = root - self.root.title("preparation Interface") + self.root.title("game Interface") self.width = 1000 self.height = 600 self.width = 1000 @@ -923,7 +923,11 @@ class gameScreen: self.gesture_predict.config(font=("Arial", 12)) self.gesture_predict.place(relx=0.2, rely=0.7, anchor='w') self.a, self.b = self.load_Function() - self.EMG_Display() + self.emg_thread = threading.Thread(target=self.EMG_Display) + self.emg_thread.start() + + + #self.EMG_Display() if 'COM6' in self.ports: self.column_limit = 9 self.last_averageRoll = 0 @@ -944,7 +948,9 @@ class gameScreen: self.yaw_label = tk.Label(self.frame1, text="yaw is : ") self.yaw_label.config(font=("Arial", 12)) self.yaw_label.place(relx=0.2, rely=0.5, anchor='w') - self.IMU_Display() + self.imu_thread = threading.Thread(target=self.IMU_Display) + self.imu_thread.start() + #self.IMU_Display() def _decode(self, serial_data): diff --git a/integration/trained-copy2.txt b/integration/trained-copy2.txt new file mode 100644 index 0000000..992ef89 --- /dev/null +++ b/integration/trained-copy2.txt @@ -0,0 +1,2 @@ +-0.5612065675615708 +54.4000262056327 -- GitLab