SX127x - Updated example

pull/1/head
Jan Gromeš 2018-07-14 10:27:14 +02:00
rodzic d630853784
commit 27d2da143e
1 zmienionych plików z 7 dodań i 8 usunięć

Wyświetl plik

@ -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) {