Another nRF24L01 Question

I’m working on a wireless traffic light. For my feeling im I very close. I’m still a bit new to arduino and the RF24 module. But i have it working but not quiet the way i wanted to work. I will post my code below.

The it’s working fine until i put the delay for the timing in the Transceiver module. If i put the timing in the TX code it’s working but if i start more then 1 receiver the loop is not syngrome. even when I restart the RX node.

Can somebody look at my code and explain what i’m doing wrong? if you have any question feel free to ask.

TX

/*
Code For Wireless traffic light Transceiver. 
Head node sends signal to 3 other nodes in a star network



*/
#include <SPI.h>
#include "nRF24L01.h"
#include "RF24.h"
int msg[1]; // Send over package message 
RF24 radio(9,10);       // Set up nRF24L01 radio on SPI bus plus pins 9 & 10 
const uint64_t pipe = 0xE8E8F0F0E1LL; // Radio pipe addresses for the 2 nodes to communicate.

int red = 5; // LED red on pin 7 
int orange = 4; // LED orange on pin 6 
int green = 3; // LED green on pin 5

void setup(void){ //Setup and configure rf radio
  Serial.begin(9600);
  radio.begin();
  radio.openWritingPipe(pipe);  // Open pipe to other nodes for communication
 
  pinMode (red, OUTPUT); // Pinmode for LED OUTPUT
  pinMode (orange, OUTPUT); // Pinmode for LED OUTPUT
  pinMode (green, OUTPUT);} // Pinmode for LED OUTPUT
 
void loop(void){
  digitalWrite(red, HIGH); //starting red HIGH
  if (digitalRead(red) == HIGH)delay(1000);{{ // If red is HIGH Send Message 001 for 1 second
  msg[0] = 001; 
  radio.write(msg, 1);} //write msg 

  digitalWrite(orange, HIGH); //starting red HIGH
  if (digitalRead(orange) == HIGH)delay(1000);{ // If orange is HIGH Send Message 002 for 1 second
  msg[0] = 002; //
  radio.write(msg, 1);} //write msg 


  digitalWrite(green, HIGH); //starting red HIGH
  if (digitalRead(green) == HIGH)delay(1000);{ // If red is HIGH Send Message 003 for 1 second
  msg[0] = 003;
  radio.write(msg, 1); //write msg 

}  
}}

RX code

/*
Code For Wireless traffic light Receiver. 
Head node sends signal to 3 other nodes in a star network

*/

#include <SPI.h>
#include "nRF24L01.h"
#include "RF24.h"
int msg[1]; // Send over package message 
RF24 radio(9,10);       // Set up nRF24L01 radio on SPI bus plus pins 9 & 10 
const uint64_t pipe = 0xE8E8F0F0E1LL; // Radio pipe addresses for the 2 nodes to communicate.

int red = 5; // LED red on pin 7 
int orange = 4; // LED orange on pin 6 
int green = 3; // LED green on pin 5

void setup(void){ //Setup and configure rf radio
  Serial.begin(9600);
  radio.begin();
  radio.openReadingPipe(1,pipe); //Open pipe to base node for communication 
  radio.startListening(); //Starting to listen to base node 
  delay(40);
  
  pinMode (red, OUTPUT); // Pinmode for LED OUTPUT
  pinMode (orange, OUTPUT); // Pinmode for LED OUTPUT
  pinMode (green, OUTPUT);} // Pinmode for LED OUTPUT
 
void loop(void){
  if (radio.available()){ // if Radio available start Communication 
    bool done = false;    
    while (!done){ 
      done = radio.read(msg, 1);  // if done read msg     
      Serial.println(msg[0]); // print msg 
      if (msg[0] == 001){delay(10); // if msg 0 is 001 light red will start 
      digitalWrite(red, HIGH);
      digitalWrite(orange, LOW);
      digitalWrite(green, LOW);
 //     delay(1000);}
      if (msg[0] == 002){delay(10);// if msg 0 is 002 light orange will start
      digitalWrite(red, LOW);
      digitalWrite(orange, HIGH);
      digitalWrite(green, LOW);
 //     delay(1000);}
      if (msg[0] == 003){delay(10);// if msg 0 is 001 light red will start
      digitalWrite(red, LOW);
      digitalWrite(orange, LOW);
      digitalWrite(green, HIGH);
//      delay(1000);}
}}
 
 
 
  else{Serial.println("No radio available");}}