Example to detect interference on the various channels available. This is a good diagnostic tool to check whether you're picking a good channel for your application.
Inspired by cpixip. See http://arduino.cc/forum/index.php/topic,54795.0.html
35RF24 radio(CE_PIN, CSN_PIN);
41const uint8_t num_channels = 126;
42uint8_t values[num_channels];
55 Serial.println(F(
"\n\rRF24/examples/scanner/"));
62 radio.setAutoAck(
false);
65 radio.startListening();
66 radio.stopListening();
72 while (i < num_channels) {
73 Serial.print(i >> 4, HEX);
78 while (i < num_channels) {
79 Serial.print(i & 0xf, HEX);
90const int num_reps = 100;
91bool constCarrierMode = 0;
97 if (Serial.available()) {
98 char c = Serial.read();
100 constCarrierMode = 1;
101 radio.stopListening();
103 Serial.println(
"Starting Carrier Out");
105 }
else if (c ==
'e') {
106 constCarrierMode = 0;
107 radio.stopConstCarrier();
108 Serial.println(
"Stopping Carrier Out");
113 if (constCarrierMode == 0) {
115 memset(values, 0,
sizeof(values));
118 int rep_counter = num_reps;
119 while (rep_counter--) {
120 int i = num_channels;
126 radio.startListening();
128 radio.stopListening();
131 if (radio.testCarrier()) {
140 while (i < num_channels) {
142 Serial.print(min(0xf, values[i]), HEX);
144 Serial.print(F(
"-"));
Driver class for nRF24L01(+) 2.4GHz Wireless Transceiver.
#define delayMicroseconds(usec)