diff --git a/examples/nRF24/nRF24_Receive/nRF24_Receive.ino b/examples/nRF24/nRF24_Receive_Blocking/nRF24_Receive_Blocking.ino similarity index 72% rename from examples/nRF24/nRF24_Receive/nRF24_Receive.ino rename to examples/nRF24/nRF24_Receive_Blocking/nRF24_Receive_Blocking.ino index 47131411..6ae29bba 100644 --- a/examples/nRF24/nRF24_Receive/nRF24_Receive.ino +++ b/examples/nRF24/nRF24_Receive_Blocking/nRF24_Receive_Blocking.ino @@ -1,19 +1,23 @@ /* - RadioLib nRF24 Receive Example + RadioLib nRF24 Blocking Receive Example - This example listens for FSK transmissions using nRF24 2.4 GHz radio module. - To successfully receive data, the following settings have to be the same - on both transmitter and receiver: - - carrier frequency - - data rate - - transmit pipe on transmitter must match receive pipe - on receiver + This example listens for FSK transmissions using nRF24 2.4 GHz radio module. + To successfully receive data, the following settings have to be the same + on both transmitter and receiver: + - carrier frequency + - data rate + - transmit pipe on transmitter must match receive pipe on receiver - For default module settings, see the wiki page - https://github.com/jgromes/RadioLib/wiki/Default-configuration#nrf24 + Using blocking receive is not recommended, as it will lead + to significant amount of timeouts, inefficient use of processor + time and can some miss packets! + Instead, interrupt receive is recommended. - For full API reference, see the GitHub Pages - https://jgromes.github.io/RadioLib/ + For default module settings, see the wiki page + https://github.com/jgromes/RadioLib/wiki/Default-configuration#nrf24 + + For full API reference, see the GitHub Pages + https://jgromes.github.io/RadioLib/ */ // include the library diff --git a/examples/nRF24/nRF24_Transmit/nRF24_Transmit.ino b/examples/nRF24/nRF24_Transmit_Blocking/nRF24_Transmit_Blocking.ino similarity index 95% rename from examples/nRF24/nRF24_Transmit/nRF24_Transmit.ino rename to examples/nRF24/nRF24_Transmit_Blocking/nRF24_Transmit_Blocking.ino index 0b8c516c..10a79630 100644 --- a/examples/nRF24/nRF24_Transmit/nRF24_Transmit.ino +++ b/examples/nRF24/nRF24_Transmit_Blocking/nRF24_Transmit_Blocking.ino @@ -59,12 +59,15 @@ void setup() { } } +// counter to keep track of transmitted packets +int count = 0; + void loop() { Serial.print(F("[nRF24] Transmitting packet ... ")); // you can transmit C-string or Arduino string up to // 32 characters long - int state = radio.transmit("Hello World!"); + int state = radio.transmit("Hello World! #" + String(count++)); if (state == RADIOLIB_ERR_NONE) { // the packet was successfully transmitted