[CC1101] Renamed basic examples to _Blocking

This commit is contained in:
jgromes 2023-06-24 19:51:09 +02:00
parent 36530b00fc
commit ac78f31532
2 changed files with 35 additions and 23 deletions

View file

@ -1,19 +1,24 @@
/* /*
RadioLib CC1101 Receive Example RadioLib CC1101 Blocking Receive Example
This example receives packets using CC1101 FSK radio module. This example receives packets using CC1101 FSK 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
- bit rate - bit rate
- frequency deviation - frequency deviation
- sync word - sync word
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#cc1101 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#cc1101
For full API reference, see the GitHub Pages
https://jgromes.github.io/RadioLib/
*/ */
// include the library // include the library

View file

@ -1,17 +1,21 @@
/* /*
RadioLib CC1101 Transmit Example RadioLib CC1101 Blocking Transmit Example
This example transmits packets using CC1101 FSK radio module. This example transmits packets using CC1101 FSK radio module.
Each packet contains up to 64 bytes of data, in the form of: Each packet contains up to 64 bytes of data, in the form of:
- Arduino String - Arduino String
- null-terminated char array (C-string) - null-terminated char array (C-string)
- arbitrary binary data (byte array) - arbitrary binary data (byte array)
For default module settings, see the wiki page Using blocking transmit is not recommended, as it will lead
https://github.com/jgromes/RadioLib/wiki/Default-configuration#cc1101 to inefficient use of processor time!
Instead, interrupt transmit 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#cc1101
For full API reference, see the GitHub Pages
https://jgromes.github.io/RadioLib/
*/ */
// include the library // include the library
@ -43,11 +47,14 @@ void setup() {
} }
} }
// use a counter to keep track of transmitted packets
int count = 0;
void loop() { void loop() {
Serial.print(F("[CC1101] Transmitting packet ... ")); Serial.print(F("[CC1101] Transmitting packet ... "));
// you can transmit C-string or Arduino string up to 63 characters long // you can transmit C-string or Arduino string up to 63 characters long
int state = radio.transmit("Hello World!"); int state = radio.transmit("Hello World! #" + String(count++));
// you can also transmit byte array up to 63 bytes long // you can also transmit byte array up to 63 bytes long
/* /*