[SX127x] Renamed basic examples to _Blocking

This commit is contained in:
jgromes 2023-06-24 22:12:53 +02:00
parent 24be1747d0
commit c919185849
4 changed files with 70 additions and 59 deletions
examples/SX127x
SX127x_Channel_Activity_Detection_Blocking
SX127x_Receive_Blocking
SX127x_Transmit_Blocking
SX127x_Transmit_Interrupt

View file

@ -1,5 +1,5 @@
/*
RadioLib SX127x Channel Activity Detection Example
RadioLib SX127x Blocking Channel Activity Detection Example
This example scans the current LoRa channel and detects
valid LoRa preambles. Preamble is the first part of
@ -9,6 +9,11 @@
Other modules from SX127x/RFM9x 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#sx127xrfm9x---lora-modem

View file

@ -1,5 +1,5 @@
/*
RadioLib SX127x Receive Example
RadioLib SX127x Blocking Receive Example
This example listens for LoRa transmissions using SX127x Lora modules.
To successfully receive data, the following settings have to be the same
@ -13,6 +13,11 @@
Other modules from SX127x/RFM9x 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#sx127xrfm9x---lora-modem
@ -53,9 +58,6 @@ void loop() {
Serial.print(F("[SX1278] 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 SX127x Transmit Example
RadioLib SX127x Blocking Transmit Example
This example transmits packets using SX1278 LoRa radio module.
Each packet contains up to 255 bytes of data, in the form of:
@ -9,6 +9,10 @@
Other modules from SX127x/RFM9x 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#sx127xrfm9x---lora-modem
@ -55,15 +59,15 @@ void setup() {
*/
}
// counter to keep track of transmitted packets
int count = 0;
void loop() {
Serial.print(F("[SX1278] Transmitting packet ... "));
// you can transmit C-string or Arduino string up to
// 255 characters long
// NOTE: transmit() is a blocking method!
// See example SX127x_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

@ -63,7 +63,7 @@ void setup() {
/*
byte byteArr[] = {0x01, 0x23, 0x45, 0x67,
0x89, 0xAB, 0xCD, 0xEF};
state = radio.startTransmit(byteArr, 8);
transmissionState = radio.startTransmit(byteArr, 8);
*/
}
@ -115,13 +115,13 @@ void loop() {
// you can transmit C-string or Arduino string up to
// 255 characters long
transmissionState = radio.startTransmit("Hello World!");
transmissionState = radio.startTransmit("Hello World! #" + String(count++));
// you can also transmit byte array up to 255 bytes long
/*
byte byteArr[] = {0x01, 0x23, 0x45, 0x67,
0x89, 0xAB, 0xCD, 0xEF};
int state = radio.startTransmit(byteArr, 8);
transmissionState = radio.startTransmit(byteArr, 8);
*/
}
}