Skip to main content
Bumped by Community user
Bumped by Community user
Bumped by Community user
deleted 24 characters in body
Source Link
dda
  • 1.6k
  • 1
  • 12
  • 18

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);
  }
}

This is my sample RX code for 4 Tx and 1 Rx nRF24l01+ modules. I want to store all the 4 received data 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);
 }
}

This is my sample RX code for 4 Tx and 1 Rx nRF24l01+ modules. I want to store all the 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);
  }
}
Bumped by Community user
Source Link

How can I store the received data from nRF24l01+ module in an array (code in description)?

This is my sample RX code for 4 Tx and 1 Rx nRF24l01+ modules. I want to store all the 4 received data 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);
 }
}