[nRF24] Renamed basic examples to _Blocking
This commit is contained in:
parent
ac78f31532
commit
90368db27a
2 changed files with 20 additions and 13 deletions
|
@ -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.
|
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
|
To successfully receive data, the following settings have to be the same
|
||||||
on both transmitter and receiver:
|
on both transmitter and receiver:
|
||||||
- carrier frequency
|
- carrier frequency
|
||||||
- data rate
|
- data rate
|
||||||
- transmit pipe on transmitter must match receive pipe
|
- transmit pipe on transmitter must match receive pipe on receiver
|
||||||
on receiver
|
|
||||||
|
|
||||||
For default module settings, see the wiki page
|
Using blocking receive is not recommended, as it will lead
|
||||||
https://github.com/jgromes/RadioLib/wiki/Default-configuration#nrf24
|
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
|
For default module settings, see the wiki page
|
||||||
https://jgromes.github.io/RadioLib/
|
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
|
// include the library
|
|
@ -59,12 +59,15 @@ void setup() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// counter to keep track of transmitted packets
|
||||||
|
int count = 0;
|
||||||
|
|
||||||
void loop() {
|
void loop() {
|
||||||
Serial.print(F("[nRF24] Transmitting packet ... "));
|
Serial.print(F("[nRF24] Transmitting packet ... "));
|
||||||
|
|
||||||
// you can transmit C-string or Arduino string up to
|
// you can transmit C-string or Arduino string up to
|
||||||
// 32 characters long
|
// 32 characters long
|
||||||
int state = radio.transmit("Hello World!");
|
int state = radio.transmit("Hello World! #" + String(count++));
|
||||||
|
|
||||||
if (state == RADIOLIB_ERR_NONE) {
|
if (state == RADIOLIB_ERR_NONE) {
|
||||||
// the packet was successfully transmitted
|
// the packet was successfully transmitted
|
Loading…
Add table
Reference in a new issue