|
@@ -29,7 +29,7 @@ class Stethoskop:
|
|
|
"""
|
|
|
|
|
|
|
|
|
- def __init__(self, SAMPLE_RATE:int, SIGNAL_PIN:Pin = Pin(26), GROVE_CONNECTOR_NR:int = 0, MAX_DATA:int = 8000):
|
|
|
+ def __init__(self, SAMPLE_RATE:int, SIGNAL_PIN:Pin = Pin(26), GROVE_CONNECTOR_NR:int = 0, MAX_DATA:int = 2048):
|
|
|
"""_summary_
|
|
|
|
|
|
Args:
|
|
@@ -287,19 +287,19 @@ class Stethoskop:
|
|
|
|
|
|
self.f.write(v)
|
|
|
|
|
|
- def record_data(self, time_in_s):
|
|
|
+ def record_data(self, time_seconds):
|
|
|
|
|
|
- max = time_in_s * self.SAMPLE_RATE
|
|
|
+ max = time_seconds * self.SAMPLE_RATE
|
|
|
|
|
|
self.f = open("data.bin", mode='wb')
|
|
|
|
|
|
self.__timer_isr.init(mode=Timer.PERIODIC, freq=self.SAMPLE_RATE, callback=self.__isr)
|
|
|
-
|
|
|
+
|
|
|
while self.counter < max:
|
|
|
pass
|
|
|
|
|
|
self.f.close()
|
|
|
-
|
|
|
+
|
|
|
self.__timer_isr.deinit()
|
|
|
|
|
|
|
|
@@ -436,7 +436,7 @@ class Stethoskop:
|
|
|
if self.__lock.locked(): self.__lock.release()
|
|
|
print(f"Lock1: {self.__lock.locked()}")
|
|
|
|
|
|
- def GetData(self):
|
|
|
+ def get_data(self):
|
|
|
"""Returns all available Data depending if there is data available
|
|
|
Else it will return an empty array
|
|
|
|