Ping Ping entre un Master et un slave LORA

Dependencies:   SX1272Lib mbed

Fork of SX1272PingPong by Semtech

Files at this revision

API Documentation at this revision

Comitter:
montagny
Date:
Tue Mar 06 20:12:31 2018 +0000
Parent:
15:063aa5212203
Commit message:
ok

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
diff -r 063aa5212203 -r ef85c3a61509 main.cpp
--- a/main.cpp	Mon Mar 05 21:09:52 2018 +0000
+++ b/main.cpp	Tue Mar 06 20:12:31 2018 +0000
@@ -3,31 +3,29 @@
 #include "sx1272-hal.h"
 #include "debug.h"
 
-#define DEBUG_MESSAGE   1
+#define DEBUG_MESSAGE                         0
 
 /* Set this flag to '1' to use the LoRa modulation or to '0' to use FSK modulation */
-#define USE_MODEM_LORA  1
-#define USE_MODEM_FSK   !USE_MODEM_LORA
+#define USE_MODEM_LORA                        1
+#define USE_MODEM_FSK                         !USE_MODEM_LORA
 
-#define RF_FREQUENCY                                    868000000 // Hz
-#define TX_OUTPUT_POWER                                 14    // 14 dBm
+#define RF_FREQUENCY                          868000000 // Hz
+#define TX_OUTPUT_POWER                       14    // 14 dBm
 /**** LORA_BANDWIDTH 0:125khz / 1:250khz / 2:500khz ****/
-#define LORA_BANDWIDTH                                  2 
-#define LORA_SPREADING_FACTOR                       8         // [SF7..SF12]
+#define LORA_BANDWIDTH                        2 
+#define LORA_SPREADING_FACTOR                 7         // [SF7..SF12]
 /**** LORA_CODINGRATE 1:4/5  /  2:4/6  / 3:4/7  /  4:4/8 ****/ 
-#define LORA_CODINGRATE                             1         // [1: 4/5,
-#define LORA_PREAMBLE_LENGTH                        8         // Same for Tx and Rx
-#define LORA_SYMBOL_TIMEOUT                         5         // Symbols
-#define LORA_FIX_LENGTH_PAYLOAD_ON                  false
-#define LORA_FHSS_ENABLED                           false  
-#define LORA_NB_SYMB_HOP                            4     
-#define LORA_IQ_INVERSION_ON                        false
-#define LORA_CRC_ENABLED                            true
+#define LORA_CODINGRATE                       1         // [1: 4/5,
+#define LORA_PREAMBLE_LENGTH                  8         // Same for Tx and Rx
+#define LORA_SYMBOL_TIMEOUT                   5         // Symbols
+#define LORA_FIX_LENGTH_PAYLOAD_ON            false
+#define LORA_FHSS_ENABLED                     false  
+#define LORA_NB_SYMB_HOP                      4     
+#define LORA_IQ_INVERSION_ON                  false
+#define LORA_CRC_ENABLED                      true
 
-
-
-#define RX_TIMEOUT_VALUE                            3500      // in ms
-#define BUFFER_SIZE                                 32        // Define the payload size here
+#define RX_TIMEOUT_VALUE                      3500      // in ms
+#define BUFFER_SIZE                           32        // Define the payload size here
 
 DigitalOut led( LED1 );
 
@@ -38,14 +36,11 @@
 {
     LOWPOWER = 0,
     IDLE,
-
     RX,
     RX_TIMEOUT,
     RX_ERROR,
-
     TX,
     TX_TIMEOUT,
-
     CAD,
     CAD_DONE
 }AppStates_t;