From e22c7fd85cb132b335247a41d96c230b36d56c15 Mon Sep 17 00:00:00 2001
From: su530201 <olivier.kaufmann@umons.ac.be>
Date: Sun, 30 Apr 2023 16:10:05 +0200
Subject: [PATCH] Fixes bug related to MUX_CONFIG in hardware_system

---
 hardware_system.py | 2 +-
 test_mux_2024.py   | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/hardware_system.py b/hardware_system.py
index 1e2fdfe7..ad800545 100644
--- a/hardware_system.py
+++ b/hardware_system.py
@@ -281,7 +281,7 @@ class OhmPiHardware:
             for i in range(len(electrodes)):
                 elec_dict[roles[i]].append(electrodes[i])
             mux_workers = []
-            for mux in self.mux_boards:
+            for _, mux in self.mux_boards.items():
                 # start a new thread to perform some work
                 mux_workers.append(Thread(target=mux.switch, kwargs={'elec_dict': elec_dict}))
             for mux_worker in mux_workers:
diff --git a/test_mux_2024.py b/test_mux_2024.py
index 5c12546b..d125f0f2 100644
--- a/test_mux_2024.py
+++ b/test_mux_2024.py
@@ -19,7 +19,7 @@ time.sleep(8)
 #mux.switch({'A': [1], 'B': [4], 'M': [2], 'N': [3]}, state='off')
 mux.reset()
 mux.test({'A': [9, 10, 11, 12, 13, 14, 15, 16], 'B': [9, 10, 11, 12, 13, 14, 15, 16],
-          'M': [9, 10, 11, 12, 13, 14, 15, 16], 'N': [9, 10, 11, 12, 13, 14, 15, 16]}, activation_time=.25)
+          'M': [9, 10, 11, 12, 13, 14, 15, 16], 'N': [9, 10, 11, 12, 13, 14, 15, 16]}, activation_time=.1)
 
 # mux as part of a OhmPiHardware system
 from OhmPi.hardware_system import OhmPiHardware
-- 
GitLab