[SX128x] Renamed basic examples to _Blocking

This commit is contained in:
jgromes 2023-06-24 22:17:13 +02:00
parent c919185849
commit 3a07f0aa02
4 changed files with 68 additions and 54 deletions

View file

@ -1,11 +1,16 @@
/*
RadioLib SX128x Channel Activity Detection Example
RadioLib SX128x Blocking Channel Activity Detection Example
This example uses SX1280 to scan the current LoRa
channel and detect ongoing LoRa transmissions.
Other modules from SX128x family can also be used.
Using blocking CAD is not recommended, as it will lead
to significant amount of timeouts, inefficient use of processor
time and can some miss packets!
Instead, interrupt CAD is recommended.
For default module settings, see the wiki page
https://github.com/jgromes/RadioLib/wiki/Default-configuration#sx128x---lora-modem

View file

@ -1,5 +1,5 @@
/*
RadioLib SX128x Receive Example
RadioLib SX128x Blocking Receive Example
This example listens for LoRa transmissions using SX126x Lora modules.
To successfully receive data, the following settings have to be the same
@ -13,6 +13,11 @@
Other modules from SX128x family can also be used.
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 default module settings, see the wiki page
https://github.com/jgromes/RadioLib/wiki/Default-configuration#sx128x---lora-modem
@ -53,9 +58,6 @@ void loop() {
Serial.print(F("[SX1280] Waiting for incoming transmission ... "));
// you can receive data as an Arduino String
// NOTE: receive() is a blocking method!
// See example ReceiveInterrupt for details
// on non-blocking reception method.
String str;
int state = radio.receive(str);

View file

@ -1,5 +1,5 @@
/*
RadioLib SX128x Transmit Example
RadioLib SX128x Blocking Transmit Example
This example transmits packets using SX1280 LoRa radio module.
Each packet contains up to 256 bytes of data, in the form of:
@ -9,6 +9,10 @@
Other modules from SX128x family can also be used.
Using blocking transmit is not recommended, as it will lead
to inefficient use of processor time!
Instead, interrupt transmit is recommended.
For default module settings, see the wiki page
https://github.com/jgromes/RadioLib/wiki/Default-configuration#sx128x---lora-modem
@ -62,15 +66,15 @@ void setup() {
*/
}
// counter to keep track of transmitted packets
int count = 0;
void loop() {
Serial.print(F("[SX1280] Transmitting packet ... "));
// you can transmit C-string or Arduino string up to
// 256 characters long
// NOTE: transmit() is a blocking method!
// See example SX128x_Transmit_Interrupt for details
// on non-blocking transmission method.
int state = radio.transmit("Hello World!");
int state = radio.transmit("Hello World! #" + String(count++));
// you can also transmit byte array up to 256 bytes long
/*

View file

@ -82,6 +82,9 @@ void setFlag(void) {
transmittedFlag = true;
}
// counter to keep track of transmitted packets
int count = 0;
void loop() {
// check if the previous transmission finished
if(transmittedFlag) {
@ -111,13 +114,13 @@ void loop() {
// you can transmit C-string or Arduino string up to
// 256 characters long
transmissionState = radio.startTransmit("Hello World!");
transmissionState = radio.startTransmit("Hello World! #" + String(count++));
// you can also transmit byte array up to 256 bytes long
/*
byte byteArr[] = {0x01, 0x23, 0x45, 0x67,
0x89, 0xAB, 0xCD, 0xEF};
int state = radio.startTransmit(byteArr, 8);
transmissionState = radio.startTransmit(byteArr, 8);
*/
}
}