From 27d2da143e41ca29b68814c1cad32cec970a5905 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Grome=C5=A1?= Date: Sat, 14 Jul 2018 10:27:14 +0200 Subject: [PATCH] SX127x - Updated example --- examples/SX127x_Settings/SX127x_Settings.ino | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/examples/SX127x_Settings/SX127x_Settings.ino b/examples/SX127x_Settings/SX127x_Settings.ino index 68beed8e..8c582982 100644 --- a/examples/SX127x_Settings/SX127x_Settings.ino +++ b/examples/SX127x_Settings/SX127x_Settings.ino @@ -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) {