nrf24l01 multiple rx pipe problem

Hi there, I am planning to make a star configuration network with nrf and I am using one tx and 4 rx modules. on the tx side I wroteconst uint64_t pipe[4] = {0xE8E8F0F0E1LL, 0xE8E8F0F0E2LL, 0xE8E8F0F0E3LL, 0xE8E8F0F0E4LL}; and

radio.openWritingPipe(pipe[1]);
  radio.openWritingPipe(pipe[2]); radio.openWritingPipe(pipe[3]);

on the rx side however

#include <Bounce2.h>

#include <SPI.h>            
#include "nRF24L01.h"
#include "RF24.h"
byte msg[1];          ////////msg[2]

RF24 radio(9, 10);
const uint64_t pipe[4] = {0xE8E8F0F0E1LL, 0xE8E8F0F0E2LL, 0xE8E8F0F0E3LL, 0xE8E8F0F0E4LL};


byte green_mos_gnd = 3;
byte orange_mos_gnd = 4;

byte green_mos_pole = 5;
byte red_mos_pole = 6;

void setup(void) {
  pinMode(green_mos_gnd, OUTPUT);
  pinMode(orange_mos_gnd, OUTPUT);

  pinMode(green_mos_pole, OUTPUT);
  pinMode(red_mos_pole, OUTPUT);
 
  Serial.begin(9600);
  radio.begin();
  radio.openReadingPipe(4,pipe[4]);
  radio.startListening();
  radio.setChannel(108);
  radio.setDataRate(RF24_1MBPS);
  radio.setPALevel(RF24_PA_HIGH);
}

void loop(void) {
  if (radio.available()) {

   
    while (!done) {
      done = radio.read(msg, 1);


      if (msg[0] == 111) {
        
        digitalWrite(LED1, HIGH);
        Serial.println(msg[0]);
      }

      if (msg[0] == 113) {
        //delay(10);
        digitalWrite(LED2, HIGH);
        Serial.println(msg[0]);
      }


    }
  }
  Serial.println("empty");
  //delay(500);
}

On the rx side gave an error called "done was not declared in this scope" what did I do wrong? Thanks for any help.

You haven't initialized the done variable.

On the rx side gave an error called "done was not declared in this scope" what did I do wrong?

Well, what scope IS done declared in?

SamIAm93:
You haven't initialized the done variable.

OP hasn't declared it, either.

in this code done wasnt declared too but it works

#include <SPI.h>
#include "nRF24L01.h"
#include "RF24.h"
byte msg[1];
RF24 radio(9, 10);
const uint64_t pipe = 0xE8E8F0F0E1LL;
int LED1 = 3;
int LED2 = 5;
int indicator = 2;
void setup(void) {
  pinMode(LED1, OUTPUT);
  pinMode(LED2, OUTPUT);
  pinMode(indicator, OUTPUT);
  Serial.begin(9600);
  radio.begin();
  radio.openReadingPipe(1, pipe);
  radio.startListening();
  radio.setChannel(108);
  radio.setDataRate(RF24_2MBPS);
  radio.setPALevel(RF24_PA_HIGH);
}

void loop(void) {
  if (radio.available()) {

    digitalWrite(indicator, HIGH);
    bool done = false;
    while (!done) {
      done = radio.read(msg, 1);


      if (msg[0] == 111) {
        //delay(10);
        digitalWrite(LED1, HIGH);
        Serial.println(msg[0]);
      }

      if (msg[0] == 113) {
        //delay(10);
        digitalWrite(LED2, HIGH);
        Serial.println(msg[0]);
      }


    }
  }
  Serial.println("empty");
  //delay(500);
}

hacknmake:
in this code done wasnt declared too but it works

No. It is declared (and initialized).

    bool done = false;

solved it. this topic can be deleted thanks

hacknmake:
solved it. this topic can be deleted thanks

Topics are not deleted.

They remain available so others can benefit from your experience.

...R