Commit b67e3862 authored by Olivier Kaufmann's avatar Olivier Kaufmann
Browse files

Checks ohmpi_card sampling rates

Showing with 4 additions and 3 deletions
+4 -3
......@@ -174,9 +174,10 @@ class OhmPiHardware:
sample += 1
sleep_time = self._start_time + datetime.timedelta(seconds=sample / sampling_rate) - lap
if sleep_time.total_seconds() < 0.:
for i in range(int(sampling_rate * np.abs(sleep_time.total_seconds()))):
_readings.append([elapsed_seconds(self._start_time), self._pulse, self.tx.polarity, np.nan, np.nan])
sample += 1
# for i in range(int(sampling_rate * np.abs(sleep_time.total_seconds()))):
# _readings.append([elapsed_seconds(self._start_time), self._pulse, self.tx.polarity, np.nan, np.nan])
# sample += 1
sample += int(sampling_rate * np.abs(sleep_time.total_seconds()))
else:
time.sleep(np.max([0., sleep_time.total_seconds()]))
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment