Light installation strobe interval advice with HC-S04 sensors: pics&code incl.

wvmarle:
First you talk about strobe (typically several flashes per second) but then you really do a slow on/off switch of 10-20 seconds. I was already wondering how you would do a strobe with relays, as they're too slow for that.

For your code: the pulseIn() function has a default timeout of 1 second, so reading three sensors means your program is stuck for over 3 seconds at a time. That's likely to give performance issues.

Add a timeout to the pulseIn() call. Your distance limit is 3 meters, make that 5 meters, sound travels 10 meters (5 meters there and back) in 33333 µs, so you can set your timeout to that value. Will make your code much more responsive.

durationA = pulseIn(echoPinA, HIGH, 33333);