Sound Sensor not working as expected

Hi all,

I am doing my first Grove Pi (and also Raspi project) which consists on having a Sound Sensor as INPUT and, as output, I am using red led, buzzer and RGB LCD screen.
Basically, I have put a WHILE TRUE structure which checks if Sound detected and an IF statement that turns red light, writes a message on the LCD and makes buzzer sound when someone speaks.

For being my first project I am pretty happy, however, I am finding strange that when speaking (or doing noise) continuously, the outputs are not working continuously. It seems as it would be checking the values with a pause between each. I have tried making permanent sound by putting an infinite LOOP and that works fine so issue seems to be related to Sound Sensor.

Has anyone experienced something similar? Any ideas?

Many thanks in advance.


Hey Alejandro,
The sound sensor does not give continuous values, each reading takes something like 50-100ms to complete, so the while True loop will still return values every 50-100ms.