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
Use ctrl+C to exit
44RF24 radio(CE_PIN, CSN_PIN);
51const uint8_t num_channels = 126;
52uint8_t values[num_channels];
54const int num_reps = 100;
57int main(
int argc,
char** argv)
62 printf(
"%s", argv[0]);
69 radio.setAutoAck(
false);
72 radio.startListening();
73 radio.stopListening();
80 while (i < num_channels) {
87 while (i < num_channels) {
88 printf(
"%x", i & 0xf);
96 memset(values, 0,
sizeof(values));
99 int rep_counter = num_reps;
100 while (rep_counter--) {
102 int i = num_channels;
109 radio.startListening();
111 radio.stopListening();
114 if (radio.testCarrier()) {
122 while (i < num_channels) {
124 printf(
"%x", min(0xf, (values[i] & 0xf)));
Driver class for nRF24L01(+) 2.4GHz Wireless Transceiver.
#define delayMicroseconds(usec)