You will need to install this library to make the transceivers work. You can download the zip file and under Sketch >> Include Library, select "Add ZIP Library..." or extract the zip file and save the contents in "C:\Users\username\Documents\Arduino\libraries". For a more complete set of instructions for installation, please read this file (Thanks to Andrew for creating this doc).
MISO connects to pin 12 of the NANOMOSI connects to pin 11 of the NANO
SCK connects to pin 13 of the NANO
CE connects to pin 9 of the NANO
CSN connects to pin 8 of the NANO
GND and V+ of the NRF24L01 are connected to GND and 3V3 (Not 5V or Vcc) of the NANO
IRQ connects to nothing
#include <SPI.h>
#include <nRF24L01.h>
#include <RF24.h>
//create an RF24 object
RF24 radio(9, 8); // CE, CSN
//address through which two modules communicate.
const byte address[6] = "00001";
int counter = 0;
char textTX[32];
void setup()
{
radio.begin();
Serial.begin(9600);
//set the address
radio.openWritingPipe(address);
//Set module as transmitter
radio.stopListening();
}
void loop()
{
//Send message to receiver
String text = "Hello World ";
text += counter;
Serial.println(text);
text.toCharArray(textTX, text.length()+1);
radio.write(&textTX, sizeof(textTX));
counter++;
if (counter > 99) counter = 0;
delay(1000);
}