kopia lustrzana https://github.com/jgromes/RadioLib
SX127x - Updated example
rodzic
d630853784
commit
27d2da143e
|
@ -92,12 +92,17 @@ void setup() {
|
|||
}
|
||||
|
||||
// you can also change the settings at runtime
|
||||
// and check if the configuration was changed successfully
|
||||
|
||||
// different modules accept different parameters
|
||||
// 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
|
||||
if(loraSX1278.setBandwidth(250.0) == ERR_INVALID_BANDWIDTH) {
|
||||
Serial.println("Selected bandwidth is invalid for this module!");
|
||||
|
@ -116,12 +121,6 @@ void setup() {
|
|||
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
|
||||
// NOTE: value 0x34 is reserved for LoRaWAN networks and should not be used
|
||||
if(loraSX1278.setSyncWord(0x14) != ERR_NONE) {
|
||||
|
|
Ładowanie…
Reference in New Issue