I have setup three arduino's with nRF24L01, two of them are transmitting and one is receiving from both the transmitter's. I am receiving some error from my receiver code , can anyone help me correct that error and figure out this communication.
here are my codes.
Transmitter 1
#include <SPI.h>
#include <nRF24L01.h>
#include <RF24.h>
RF24 radio(7,8);
//char variable = 'A';
int n=0;
//const byte rxAddr[6] = "00001";
const uint64_t pipes[3] = {"00001","00010","00011"};
void setup()
{
Serial.begin(9600);
radio.begin();
radio.setRetries(15, 15);
radio.openWritingPipe(pipes[2]);
radio.stopListening();
}
void loop()
{
if(n<100)
{
char text[32];
snprintf(text, 31, "0101100200350%d", n);
radio.write(&text, sizeof(text));
Serial.println(text);
//variable ++;
n++;
}
}
Transmitter 2:-
#include <SPI.h>
#include <nRF24L01.h>
#include <RF24.h>
RF24 radio(7,8);
//char variable = 'A';
int n=101;
//const byte rxAddr[6] = "00001";
const uint64_t pipes[3] = {"00001","00010","00011"};
void setup()
{
Serial.begin(9600);
radio.begin();
radio.setRetries(15, 15);
radio.openWritingPipe(pipes[1]);
radio.stopListening();
}
void loop()
{
if(n<201)
{
char text[32];
snprintf(text, 31, "0101100200350%d", n);
radio.write(&text, sizeof(text));
Serial.println(text);
//variable ++;
n++;
}
}
Receiver :-
#include <SPI.h>
#include <nRF24L01.h>
#include <RF24.h>
RF24 radio(7, 8);
//const byte rxAddr[6] = "00001";
uint64_t pipes[3] = {"00001","00010","00011"};
int counter = 0;
void setup()
{
while (!Serial);
Serial.begin(9600);
radio.begin();
radio.openReadingPipe(0, pipes[1]);
radio.openReadingPipe(0, pipes[2]);
radio.startListening();
}
void loop()
{
getDataPipe1();
getDataPipe2();
}
void getDataPipe1()
{
if (radio.available(&pipes[1]))
{
char text[32] = {0};
radio.read(&text, sizeof(text));
counter++;
Serial.println(text);
}
}
void getDataPipe2()
{
if (radio.available(&pipes[2]))
{
char text[32] = {0};
radio.read(&text, sizeof(text));
counter++;
Serial.println(text);
}
}
The error i am receiving with my receiver is this :-
"no matching function for call to 'RF24::available(uint64_t*)'"
Thanks In Advance!!