This is my sample RX code for 4 Tx and 1 Rx nRF24l01+ modules. I want to store all the 4 received data received from 4 pipes into an array (recArray).
#include <SPI.h>
#include <nRF24L01.h>
#include <RF24.h>
RF24 radio(7, 8);
const uint64_t pipes[4] = {0xF0F0F0F0E1LL, 0xF0F0F0F0E2LL, 0xF0F0F0F0E3LL,
0xF0F0F0F0E4LL};
char text[32] = {0}; #received data
int recArray[4]={0, 0, 0, 0}; # array to store the received bytes
void setup()
{
Serial.begin(9600);
radio.begin();
radio.openReadingPipe(1, pipes[0]);
radio.openReadingPipe(2, pipes[1]);
radio.openReadingPipe(3, pipes[2]);
radio.openReadingPipe(4, pipes[3]);
radio.startListening();
}
void loop()
{
if (radio.available())
{
radio.read(&text, sizeof(text));
Serial.println(text);
}
}