I'm trying to learn how to program for the NRF24L01+ wireless radios. After reviewing many sites, I think I'm close, but still can't seem to get a basic program to work. For my simple test, I have one Arduino attached to one NRF24L01+ sending a random number. Then another Arduino attached to another NRF24L01+ to receive this number. Here's my code...
Use the same pipe for both: const uint64_t pipe = 0xF0F0F0F0D1LL;
Open a writing pipe on the receiver:
radio.openWritingPipe(pipe);
Info: The transmitter must transmit to the receiving address of the receiver for the payload to be delivered. In order for the receiver to acknowledge (ACK) transmission, it needs a writing pipe opened to send back the ACK packet.
So, if you are using that code and it doesn't work, it usually indicates another problem.
To get debugging info, you need to do a few things:
Add the printf.h file from one of the examples to your sketch folder
Add the line #include "printf.h" in your sketch
Do printf_begin(); right after Serial.begin(57600);
Finally, at the end of your setup() function, do a radio.printDetails();
It should look exactly like the attached picture on the receiver with the debug details printed.
Since you say it works fine with the getting started sketch, we know the wiring is ok, and the code works fine for me, so the code is fine, then something odd is usually to blame, but difficult to figure out from my end. Also, power cycle the Arduino, since some settings cannot be undone otherwise, and may interfere if you have been running other example sketches. Not sure what library fork you are using, but of course I am using my fork found here: https://github.com/TMRh20/RF24/archive/master.zip