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