hi everyone , I installed a circuit with ldr, laser, buzzer, led. I projected the laser on ldr. When the laser light is cut, buzzer is pulsing and the led is on. I pass a pencil in front of ldr. (my goal is to pass the pencil when it is not a drop) I want to calculate the time between the 2 passes of the pencil. I wrote the code, but once the buzzer passes, it sometimes doesn't keep quiet. After the pen has passed, it still crows. The buzzer should only sound briefly when the pen passes. how can i do that. please help me

I wrote the code,

You need to post the program so we can see it. And please use the code button </>

so your code 
looks like this

and is easy to copy to a text editor See How to use the forum