How can i turn everyting off

Hello people,

I have a IR sensor and i can read every code from every remote controller. now i have 3 relays i can put them on with button 1, 2, and 3. This is working fine but now i want that every go's ff when i puss the power button. I have absolutly no ideo how that must be.

Please someone help me!

Thanks.

#include <IRremote.h>

int RECV_PIN = 3;

IRrecv irrecv(RECV_PIN);

decode_results results;

int Button_1=0,Button_2=0,Button_3=0;
void setup()
{
  pinMode(5,OUTPUT);
  pinMode(6,OUTPUT);
  pinMode(9,OUTPUT);
  Serial.begin(9600);
  irrecv.enableIRIn(); // Start the receiver
}

void loop() {
  if (irrecv.decode(&results)) {
    if (results.value == 2545676015)
    { if ( Button_1 == 0)
    {digitalWrite(5,HIGH); Button_1=1;}
    else
    {digitalWrite(5,LOW);Button_1=0;}
    }
    if (results.value == 154895949)
    { if ( Button_2 == 0)
    {digitalWrite(6,HIGH); Button_2=1;}
    else
    {digitalWrite(6,LOW); Button_2=0;}
    }
       if (results.value == 2267322763)
    { if ( Button_3 == 0)
    {digitalWrite(9,HIGH); Button_3=1;}
    else
    {digitalWrite(9,LOW); Button_3=0;}
    }
    Serial.println(results.value, DEC);
    delay(1);
    
    irrecv.resume(); // Receive the next value
  }
 delay(250);
}

First you need to find the value of the "off" button. Then you need to add a new if like:

    if (results.value == 2545676015)