PIR Sensor HC-SR501

Hello, I'm new to the forum I have a question about the sensor HC-SR501. I want to include a lamp when detecting a trip, and in case of a second detection, turn it off. I found many things about this sensor, like code, but not what I want. Can someone help me. I will repeat: Motion detection diode 13 illuminates, second motion detection diode 13 goes out. If this sensor is not suitable for this task, suggest me another one I will be very grateful. Goodies already!

Hi,

Start by looking at: https://www.arduino.cc/en/Tutorial/Debounce

You can then replace the button with your PIR sensor.

Yours, TonyWilk

Thanks a lot for the quick answer