Example sketch showing how to create a primitive spectrum analyser with the NRF24 class. The nRF24L01 received power detector is only one bit, but this will show which channels have more than -64dBm present
#include <NRF24.h>
#include <SPI.h>
void setup()
{
Serial.begin(9600);
while (!Serial)
;
Serial.println("NRF24 init failed");
Serial.println("setRF failed");
Serial.println("powerUpRx failed");
Serial.println("initialised");
}
void loop()
{
uint8_t i;
for (i = 0; i < 50; i++)
{
Serial.println("setChannel failed");
delay(1);
Serial.print(i, DEC);
Serial.print(": ");
Serial.println(rpd);
}
Serial.println("-------------------------");
delay(1000);
}