I2C sending byte array problem

void loop() {

  waitTime = 0;
  while (wait == true) {
  msg[0] = analogRead(A0)/4;
  msg[1] = analogRead(A1)/4;
  msg[2] = analogRead(A2)/4;
  msg[3] = analogRead(A3)/4;
  wait = false;
  }

  if (wait == false) {
    digitalWrite(slaveReady, HIGH);
  }

}

For purposes of explanation, you can just change the radio code to just getting the values from direct analogRead on the slave.

My code was kinda messy and big, so i actually removed a lot of it so it was as simple as possible. So yeah, the second wait = false; is unnecessary. The reason for the while loop when getting info from radio is also because i will have to also count in the fact that this arduino might not get the signal from the transmitter, so i actually used this:

    if (radio.available()) {
      bool done = false;
      while (!done) {
        done = radio.read(msg, 4);
        digitalWrite(7, HIGH);
        wait = false;
      }
    }

So it skips the radio if its not available, and it stays in the while loop for 15 iterations, then it lowers the thrust and gets out of the loop.

Anyways, does anyone know the timings that you need to include when using wire library? For example, i thought the problem causer was that when master requests data from the slave, i didnt do any delay (since the slave has to acknowledge the request. So i put a delay there:

  if (digitalRead(comReady) == HIGH) {
    Wire.requestFrom(1, 4);    //(device addr, # of bytes)
    delayMicroseconds(200); //this delay here
    while (Wire.available()) {
      for (i = 0; i <= 3; i++) {
        dataFromCOM[i] = Wire.read();
      }
    }
  }

Despite the slave requiring less than 50us to respond, i still increased the delay to 1ms, but still same problem. I still think that this delay is unnecessary since you have the while(Wire.available()){} so it probably waits for the slave to acknowledge.

I will try fixing this with additional changes to the code, but if anyone has any idea why this is happening, please let me know.

And i really dont use the forum that much, so apologies for incorrect use of code posting.

Thank you both for the replies.