ALARME SENSOR PIR

hello I will need your help. i would just like to put my alarm off just with a push button but i do not know how to do thanks ?? here is my code.

int PIR1 = 4;// CAPTEUR DE MOUVEMENT
int siren = 13;
int PIR2 = 8;// capteur de mouvemt 2 


void setup() {
Serial.begin(9600);
delay(30000); 
pinMode(siren, OUTPUT);
digitalWrite(siren, LOW); 
pinMode(PIR1, INPUT);
pinMode(PIR2, INPUT);
digitalWrite(PIR1, LOW);
digitalWrite(PIR2, LOW);


}

void loop() { 
if(digitalRead(PIR1)==HIGH || digitalRead(PIR2)==HIGH){
digitalWrite(siren, HIGH);
delay(5000);
}

else
{ 
digitalWrite(siren, LOW); 
}
}

francis12:
i would just like to put my alarm off just with a push button

simply add a digitalread for the push button in your else statement! :slight_smile:

int siren = 13;
int PIR1 = 7;// capteur de mouvemt 1
int PIR2 = 8;// capteur de mouvemt 2
uint8_t CANCEL_SW = 3; //using pin 3 as input for push button. button switched to ground


void setup() {
  Serial.begin(9600);
  delay(30000);
  pinMode(siren, OUTPUT);
  digitalWrite(siren, LOW);
  pinMode(PIR1, INPUT);
  pinMode(CANCEL_SW, INPUT_PULLUP);

  pinMode(PIR2, INPUT);
  digitalWrite(PIR1, LOW);
  digitalWrite(PIR2, LOW);


}

void loop() {
  if (digitalRead(PIR1) == HIGH || digitalRead(PIR2) == HIGH) {
    digitalWrite(siren, HIGH);
    delay(5000);
  }

  else if (digitalRead(CANCEL_SW) == LOW)
  {
    digitalWrite(siren, LOW);
  }
}

thank you very much for answering me i tried everything works