SX127x - Updated example
This commit is contained in:
parent
d630853784
commit
27d2da143e
1 changed files with 7 additions and 8 deletions
|
@ -92,12 +92,17 @@ void setup() {
|
||||||
}
|
}
|
||||||
|
|
||||||
// you can also change the settings at runtime
|
// you can also change the settings at runtime
|
||||||
|
// and check if the configuration was changed successfully
|
||||||
|
|
||||||
// different modules accept different parameters
|
// different modules accept different parameters
|
||||||
// see https://github.com/jgromes/LoRaLib/wiki/Supported-LoRa-modules
|
// see https://github.com/jgromes/LoRaLib/wiki/Supported-LoRa-modules
|
||||||
|
|
||||||
// you can check if the setting was changed successfully
|
|
||||||
|
|
||||||
|
// set carrier frequency to 433.5 MHz
|
||||||
|
if(loraSX1278.setFrequency(433.5) == ERR_INVALID_FREQUENCY) {
|
||||||
|
Serial.println("Selected frequency is invalid for this module!");
|
||||||
|
while(true);
|
||||||
|
}
|
||||||
|
|
||||||
// set bandwidth to 250 kHz
|
// set bandwidth to 250 kHz
|
||||||
if(loraSX1278.setBandwidth(250.0) == ERR_INVALID_BANDWIDTH) {
|
if(loraSX1278.setBandwidth(250.0) == ERR_INVALID_BANDWIDTH) {
|
||||||
Serial.println("Selected bandwidth is invalid for this module!");
|
Serial.println("Selected bandwidth is invalid for this module!");
|
||||||
|
@ -116,12 +121,6 @@ void setup() {
|
||||||
while(true);
|
while(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
// set carrier frequency to 433.5 MHz
|
|
||||||
if(loraSX1278.setFrequency(433.5) == ERR_INVALID_FREQUENCY) {
|
|
||||||
Serial.println("Selected frequency is invalid for this module!");
|
|
||||||
while(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
// set LoRa sync word to 0x14
|
// set LoRa sync word to 0x14
|
||||||
// NOTE: value 0x34 is reserved for LoRaWAN networks and should not be used
|
// NOTE: value 0x34 is reserved for LoRaWAN networks and should not be used
|
||||||
if(loraSX1278.setSyncWord(0x14) != ERR_NONE) {
|
if(loraSX1278.setSyncWord(0x14) != ERR_NONE) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue