Edit sketch

hello everyone, I am a neophyte I wanted to ask how to replace the two buttons of this project with two PIR sensors? thanks : Smiley-confuse:

#define led_1 8 // il pin 8 è usato per il LED
#define led_2 9 // il pin 9 è usato per il LED
#define btn_pin1 2 // il pin 2 è usato per il PULSANTE 1
#define btn_pin2 3 // il pin 3 è usato per il PULSANTE 2

// Variabili
int in1 = 0;
int in2 = 0;

void setup() {
pinMode(led_1, OUTPUT);
pinMode(led_2, OUTPUT);
pinMode(btn_pin1, INPUT);
pinMode(btn_pin2, INPUT);
}

void loop()
{
in1 = digitalRead(btn_pin1);
in2 = digitalRead(btn_pin2);

if (in1 == HIGH){ // PULSANTE 1 premuto
digitalWrite(led_1, HIGH); // accensione LED 1
delay (2000); // ritardo di 2 sec
}
else
{
digitalWrite(led_1, LOW); // se il PULSANTE 1 non premuto LED 1 spento
}

if (in2 == HIGH){ // PULSANTE 2 premuto
digitalWrite(led_2, HIGH); // accensione LED 2
delay (2000); // ritardo di 2 sec
}
else
{
digitalWrite(led_2, LOW); // seil PULSANTE 2 non premuto LED 2 spento
}
}

What are the outputs from the PIRs when nothing is detected and when something is detected ?

images found on the internet how to replace buttons with pir sensors? thanks

pir-arduino.jpg

UKHeliBob:
What are the outputs from the PIRs when nothing is detected and when something is detected ?

when it detects a person entering a room.tanks

pir_sensor-300x300.png

vincenzo341:
when it detects a person entering a room.tanks

That doesn't answer the question.

Please remember to use code tags when posting code

AWOL:
That doesn't answer the question.

Please remember to use code tags when posting code

I'm sorry but I'm no expert I found this project, however, instead of the buttons say that you can put the detection sensors, however, I think the pir sensors does not know how to do, I would like to use it to turn on the light of a room as I passed and then it shut down to my way out of the room.

The point is a PIR sensor senses, or does not sense. motion. A switch is, or is not, pressed. One can easily be interchanged for the other.

The questions, really, are:
What have you tried?
What happened?
What did you expect to happen?

I'm sorry but I'm no expert

Please help us to help you.
What is the normal state of the PIR output, HIGH or LOW ?
Does it change when a person is detected ?

UKHeliBob:
Please help us to help you.
What is the normal state of the PIR output, HIGH or LOW ?
Does it change when a person is detected ?

this is the project. thanks again

In view of the fact that the link you provided is to a page in Italian your questions may be better answered in the Italian section of this forum.

UKHeliBob:
In view of the fact that the link you provided is to a page in Italian your questions may be better answered in the Italian section of this forum.

ok tanks