Why doesnt my code work? it's driving me nuts

Hi, can someone look into my code and tell my why it isnt working? It’s driving me nuts

first piece of code is the code of the master device communicating with the slave device that’s the second piece of code

ty <3

#include <Wire.h>

#define ADDRES 42

#define INGANG_1 2
#define INGANG_2 3
#define INGANG_3 4

#define UITGANG_1 11
#define UITGANG_2 12
#define UITGANG_3 13

byte INPUT_1=0;
byte INPUT_2=0;
byte INPUT_3=0;

byte input_ar = 0;


// ARRAY MET PINNUMMERS VOOR INPUTS

const byte inputs[] = { 2, 3, 4, 5, 6, 7, 8, 9 };



void setup() {
  // HIER WORDT AANGEGEVEN OP WELKE PIN DE INPUT EN OUTPUT IS AANGESLOTEN, OOK WORDEN DE 
  // UITGANGEN GETEST
  
  Wire.begin();
  
  pinMode(INGANG_1, INPUT);
  pinMode(INGANG_2, INPUT);
  digitalWrite(INGANG_1, HIGH);
  digitalWrite(INGANG_2, HIGH);
  
 
}

void loop() {
 // ALLE INGAGEN WORDEN GELADEN 
INPUT_1 = digitalRead(INGANG_1);
INPUT_2 = digitalRead(INGANG_2);
INPUT_3 = digitalRead(INGANG_3);


// STUREN VAN UITGANGEN (RELAIS)

  if (INPUT_1 == HIGH)   digitalWrite(UITGANG_1,HIGH);
  else if(INPUT_1 == LOW)  digitalWrite(UITGANG_1, LOW);
  if (INPUT_1 == HIGH)   bitWrite(input_ar, 0, 1);
  else if (INPUT_1 == LOW) bitWrite(input_ar, 0, 0);

  
     
   if (INPUT_2 == HIGH)  digitalWrite(UITGANG_2, HIGH);
   else if (INPUT_2 == LOW)  digitalWrite(UITGANG_2, LOW);
   if (INPUT_2 == HIGH) bitWrite(input_ar, 1, 1);
   else if (INPUT_2 == LOW) bitWrite(input_ar, 1, 0);

       
  
    if (INPUT_3 == HIGH) digitalWrite(UITGANG_3, HIGH);
    else if(INPUT_3 == LOW) digitalWrite(UITGANG_3, LOW);
    if (INPUT_3 == HIGH) bitWrite(input_ar, 2, 1);
    else if (INPUT_3 == LOW) bitWrite(input_ar, 2, 0);
    
     
    Wire.beginTransmission(ADDRES);
    Wire.write(input_ar);
    Wire.endTransmission();

    delay(500);
    }
#include <Wire.h>
#define ADDRES 42
#define UITGANG_0   2
#define UITGANG_1   3
#define UITGANG_2   4


const byte relais[] = { 2, 3, 4, 5, 6, 7, 8, 9};
int ttt=0; 
byte c =0;
void setup() {
  
Wire.begin(42);
Wire.onReceive(receiveEvent);
Serial.begin(9600);
}




void loop() {
  
  Serial.write ("test");
  if ( bitRead(c, 0) == HIGH) digitalWrite(UITGANG_0, HIGH);
  else if (bitRead(c, 0) == LOW) digitalWrite(UITGANG_0, LOW);

  if ( bitRead(c, 1) == HIGH) digitalWrite(UITGANG_1, HIGH);
  else if (bitRead(c, 1) == LOW) digitalWrite(UITGANG_1, LOW);

 if (bitRead(c, 2) == HIGH) digitalWrite(UITGANG_2, HIGH);
 else if (bitRead(c, 2) == LOW) digitalWrite(UITGANG_2, LOW);

 
  
  
  

}

void receiveEvent(int howMany) {
  while ( Wire.available () > 0){
    byte c = Wire.read();
    Serial.print(c, DEC);
    
      
    
  }

 
 
 
 
}

What is it supposed to do? What does it do instead? What parts is it connected to and how is it wired?

tell my why it isnt working?

What does it do that it shouldn’t ?
What doesn’t it do that it should ?

This is supposed to read my inputs on my Master arduino UNO and store them into a byte, then send it to the slave arduino uno through i2c communication, my idea is to read the byte here and look what input is set and make the right output high

Does any of it work ? How about printing the value of input_ar on the transmitter side ? Is it what you expect ?

on the transmitter side i recieve a 0 instead of the byte that i want to recieve

void receiveEvent(int howMany) {
  while ( Wire.available () > 0){
    byte c = Wire.read();
    Serial.print(c, DEC);
   
     
   
  }

DO NOT DO SERIAL PRINTING IN AN ISR!

Cross Post.

Answered in http://forum.arduino.cc/index.php?topic=391314.0