I'm totally new to Ardunio programming and couldn't find a relevant topic
I'd like someone to help provide code which will perform the following.
When digital input form a sound sensor goes high, turn on LED_BUILTIN for 10 seconds.
If there's sound within this 10 seconds, remain on
After 10 seconds of silence, turn off LED
The main objective is to keep a consistent HIGH state without toggling the LED_BUILTIN until the 10 seconds of silence is archived. There'll be a relay in my circuit and I'd like to prevent toggling.
It took me an additional hour to determine the sound sensor Potentiometer was set in the wrong direction. The "out" port LED on the microphone has a logic of NO SOUND = ON, SOUND = OFF.... strange.
You're scripting worked. I added missing brackets for one of the if statements, I wouldn't be surprised if it worked without them... Thank you!