Skip to content
Snippets Groups Projects
Commit 97f3ea1e authored by ym13n22's avatar ym13n22
Browse files

window1 modified but no difference

parent ad72e11d
No related branches found
No related tags found
No related merge requests found
......@@ -924,6 +924,7 @@ class gameScreen:
self.frame2.grid(row=1, column=0, padx=10, pady=10, sticky="nsew")
if 'COM5' in self.ports :
self.last_printEMG_time = time()
self.arduino_EMG = serial.Serial('COM5', 9600, timeout=1)
self.outer_EMG_label = tk.Label(self.frame2, text=f"EMG for Extensor Carpi Ulnaris is :")
self.outer_EMG_label.config(font=("Arial", 12))
......@@ -954,11 +955,11 @@ class gameScreen:
self.last_averageRoll = 0
self.last_averageyaw = 0
self.last_averagePitch = 0
self.averageroll = 0
self.averageyaw = 0
self.averagepitch = 0
self.last_print_time = time()
self.last_EMG_Command=None
self.arduino = serial.Serial('COM6', 115200)
self.roll_label = tk.Label(self.frame1, text="roll is : ")
self.roll_label.config(font=("Arial", 12))
......@@ -1016,8 +1017,18 @@ class gameScreen:
ges_predictions = "Hand Close"
if predictions == 0:
ges_predictions = "Unknown"
self.gesture_predict.config(text=f"{ges_predictions}")
self.send_command_to_unity(f"Hand :{ges_predictions}")
self.gesture_predict.config(text=f"{ges_predictions}")
self.send_command_to_unity(f"Hand :{ges_predictions}")
#current_time_EMG = time()
#if ges_predictions=="Hand Open":
#if current_time_EMG - self.last_print_time >= 0.01:
#if ges_predictions!=self.last_EMG_Command:
#self.send_command_to_unity(f"Hand :{ges_predictions}")
#self.last_print_time = current_time_EMG
#self.last_EMG_Command=ges_predictions
except Exception as e:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment