while (wait == true) { //this while loop contains the code for nfr24l01 radio module
while (radio.available()) {
bool done = false;
while (!done) {
done = radio.read(msg, 4);
digitalWrite(7, HIGH);
wait = false;
}
}
wait = false;
}
The second "wait=false" should not be there. When you first enter the outer loop, there is no guarantee that there's a radio message waiting, but you set wait to false anyway which causes you to exit the loop and signal the master that you have data.
Pete
BTW. You really don't need to attach such small files. Nor do you need to post a 141kB photo of what could be copied and pasted as text. In each case they can be posted in code tags - see How to post code properly.