Oops
This commit is contained in:
@@ -40,14 +40,15 @@ class SoundReader:
|
||||
|
||||
def _read(self):
|
||||
measure_iteration = 100
|
||||
level = 0
|
||||
i = 0
|
||||
while self._running:
|
||||
level = 0
|
||||
if GPIO.input(self._pin):
|
||||
level += 1
|
||||
if i == measure_iteration:
|
||||
self._notify(f'{{"soundSensorValue": {level}}}')
|
||||
i = 0
|
||||
level = 0
|
||||
i += 1
|
||||
time.sleep(0.02)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user