[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.
To successfully receive data, the following settings have to be the same
on both transmitter and receiver:
- carrier frequency
- bit rate
- frequency deviation
- sync word
This example receives packets using CC1101 FSK radio module.
To successfully receive data, the following settings have to be the same
on both transmitter and receiver:
- carrier frequency
- bit rate
- frequency deviation
- sync word
For default module settings, see the wiki page
https://github.com/jgromes/RadioLib/wiki/Default-configuration#cc1101
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#cc1101
For full API reference, see the GitHub Pages
https://jgromes.github.io/RadioLib/
*/
// 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.
Each packet contains up to 64 bytes of data, in the form of:
- Arduino String
- null-terminated char array (C-string)
- arbitrary binary data (byte array)
This example transmits packets using CC1101 FSK radio module.
Each packet contains up to 64 bytes of data, in the form of:
- Arduino String
- null-terminated char array (C-string)
- arbitrary binary data (byte array)
For default module settings, see the wiki page
https://github.com/jgromes/RadioLib/wiki/Default-configuration#cc1101
Using blocking transmit is not recommended, as it will lead
to inefficient use of processor time!
Instead, interrupt transmit 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#cc1101
For full API reference, see the GitHub Pages
https://jgromes.github.io/RadioLib/
*/
// include the library
@ -43,11 +47,14 @@ void setup() {
}
}
// use a counter to keep track of transmitted packets
int count = 0;
void loop() {
Serial.print(F("[CC1101] Transmitting packet ... "));
// 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
/*