Arduino and RF24L01

I have been given a task to make a 2 wheel robot and control it wireless using nrf24l01 module. My code is working ,however my lecturers want me to use the IRQ from the rf module as well. I do not have past experience in using the IRQ pin and do not know how to code for it.

Any help will be very much appreciated as it is for my school project.

Thank you.

I have been using the rf24 radios for years and never thought of using the IRQ. I always found polling to be sufficient. Your post got me curious, though. So I wired up a couple rf24s and tried it out. I use the example code from Robin2’s simple rf24 tutorial. I use the simpleTX code as is and modified the simpleRX code to us an interrupt. The rf24 reciever’s IRQ pin connects to Uno pin 2. This seems to be working nicely during my short time of experimenting.

Modified simpleRX code:

// SimpleRx - the slave or the receiver
// Modified by c. goulding (AKA groundfungus) use the rf24
// IRQ pin to signal data available.

#include <SPI.h>
#include <nRF24L01.h>
#include <RF24.h>

#define CE_PIN   9
#define CSN_PIN 10

const byte irqPin = 2;

const byte thisSlaveAddress[5] = {'R', 'x', 'A', 'A', 'A'};

RF24 radio(CE_PIN, CSN_PIN);

char dataReceived[10]; // this must match dataToSend in the TX
bool newData = false;

//===========

void setup()
{

 Serial.begin(9600);
 Serial.println("SimpleRx Starting");
 
 radio.begin();
 radio.setDataRate( RF24_250KBPS );
 radio.openReadingPipe(1, thisSlaveAddress);
 radio.startListening();
 
 attachInterrupt(digitalPinToInterrupt(irqPin), rcvISR, FALLING);
}

//=============

void loop()
{
 if (newData)
 {
    radio.read( &dataReceived, sizeof(dataReceived) );
    Serial.println(dataReceived);
    newData = false;
 }
}

//==============

void rcvISR()
{
 newData = true;
}