how to keep running program along side with piezo Buzzer at HIGH

I am doing Traffic signal simulation code with signal break detection sys. when sys detect movement on red light i raise alarm for some duration but it stops program dxecution for that much time. i want to raise alarm but also want to keep programm running.
How to overcome this?? please Help!! :disappointed_relieved: :disappointed_relieved:

Probably a programming problem, but how would we know?

Maybe the demo Several Things at a Time will give you some ideas.

If you really want help you need to post your program and explain exactly what it does and what you want it to do differently.

...R