One Receiver / Three Transmitters

Hi Good Morning I’m here stuck with a problem…

  • Actually I want to make a project in which one Nrf24l01 receiver & three Nrf24l01 transmitter.

** In each transmitter there is a push button & in receiver there is one LED.

*** Now the Project is to ON the receiver LED when any transmitter push button is pressed .

**** when I upload the below code on a single Transmitter & Receiver the circuit runs OK. but when I upload the code on 2nd transmitter & operate its Push-button the LED flicker.

Please Help

Kiran Mahapatra

---------------Receiver Code-------------------

#include <RF24.h>
#include <RF24Network.h>
#include <SPI.h>
#define led 3
RF24 radio(10, 9);               // nRF24L01 (CE,CSN)
RF24Network network(radio);      // Include the radio in the network
const uint16_t this_node = 00;   // Address of this node in Octal format ( 04,031, etc)
   
void setup() {
  SPI.begin();
  radio.begin();
  network.begin(90, this_node);  //(channel, node address)
  pinMode(led, OUTPUT);
}


void loop() {
  network.update();
  while ( network.available() ) {     // Is there any incoming data?
    RF24NetworkHeader header;
    unsigned long buttonState;
    network.read(header, &buttonState, sizeof(buttonState)); // Read the incoming data
    digitalWrite(led, !buttonState); // Turn on or off the LED
  }
}

------------------Transmitter 1--------------

#include <RF24.h>
#include <RF24Network.h>
#include <SPI.h>
#define led 3
RF24 radio(10, 9);               // nRF24L01 (CE,CSN)
RF24Network network(radio);      // Include the radio in the network
const uint16_t this_node = 00;   // Address of this node in Octal format ( 04,031, etc)
   
void setup() {
  SPI.begin();
  radio.begin();
  network.begin(90, this_node);  //(channel, node address)
  pinMode(led, OUTPUT);
}


void loop() {
  network.update();
  while ( network.available() ) {     // Is there any incoming data?
    RF24NetworkHeader header;
    unsigned long buttonState;
    network.read(header, &buttonState, sizeof(buttonState)); // Read the incoming data
    digitalWrite(led, !buttonState); // Turn on or off the LED
  }
}

--------------------Transmitter2----------------------

#include <RF24Network.h>
#include <RF24.h>
#include <SPI.h>
#define button 2
RF24 radio(10, 9);               // nRF24L01 (CE,CSN)
RF24Network network(radio);      // Include the radio in the network
const uint16_t this_node = 02;   // Address of this node in Octal format ( 04,031, etc)
const uint16_t master00 = 00;      

void setup() {
  SPI.begin();
  radio.begin();
  network.begin(90, this_node);  //(channel, node address)
}


void loop() {
  network.update();
  unsigned long buttonState = digitalRead(button);
  RF24NetworkHeader header4(master00);    // (Address where the data is going)
  bool ok3 = network.write(header4, &buttonState, sizeof(buttonState)); // Send the data
}

Moderator edit:
</mark> <mark>[code]</mark> <mark>

</mark> <mark>[/code]</mark> <mark>
tags added.

You have asked a new question in a very old Thread so I have suggested to the Moderator to move it to its own Thread.

To make it easy for people to help you please modify your post and use the code button </>
codeButton.png

so your code 
looks like this

and is easy to copy to a text editor. See How to use the Forum

In the meantime have a look at this Simple nRF24L01+ Tutorial.

It includes an example for a master and 2 slaves that can easily be extended to a larger number of slaves.

Wireless problems can be very difficult to debug so get the wireless part working on its own before you start adding any other features.

The examples are as simple as I could make them and they have worked for other Forum members. If you get stuck it will be easier to help with code that I am familiar with. Start by getting the first example to work

There is also a connection test program to check that the Arduino can talk to the nRF24 it is connected to.

...R