From 0eee2e8933a02ccf89b4a92983de827f68add649 Mon Sep 17 00:00:00 2001
From: su530201 <olivier.kaufmann@umons.ac.be>
Date: Thu, 19 Oct 2023 23:16:23 +0200
Subject: [PATCH] Fixes n_step bug

---
 ohmpi/hardware_system.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ohmpi/hardware_system.py b/ohmpi/hardware_system.py
index 6e79220a..35cfad9a 100644
--- a/ohmpi/hardware_system.py
+++ b/ohmpi/hardware_system.py
@@ -430,7 +430,7 @@ class OhmPiHardware:
                 sampling_rate = self.rx.sampling_rate
             current, voltage = 0., 0.
             diff_vab = np.inf
-            while (k < n_steps) and (diff_vab > diff_vab_lim) and (vab_list[k]>=vab_max):
+            while (k < n_steps) and (diff_vab > diff_vab_lim) and (vab_list[k]<vab_max):
                 vabs = []
                 self._vab_pulses(vab_list[k], sampling_rate=self.rx.sampling_rate, durations=[0.2, 0.2], polarities=[1, -1])
                 for pulse in range(2):
-- 
GitLab