123

Dependencies:   mbed Grove_LCD_RGB_Backlight SX1272Lib

Files at this revision

API Documentation at this revision

Comitter:
advxolltm
Date:
Mon Jun 06 13:09:46 2022 +0000
Parent:
2:2bcb1840d680
Commit message:
last version;

Changed in this revision

LoRaTransmitter.lib Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
diff -r 2bcb1840d680 -r 02bd846316e2 LoRaTransmitter.lib
--- a/LoRaTransmitter.lib	Mon Jun 06 10:43:47 2022 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-https://os.mbed.com/users/aizakharov/code/LoRaTransmitter/#30ce00fbab55
diff -r 2bcb1840d680 -r 02bd846316e2 main.cpp
--- a/main.cpp	Mon Jun 06 10:43:47 2022 +0000
+++ b/main.cpp	Mon Jun 06 13:09:46 2022 +0000
@@ -12,8 +12,8 @@
 #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                                    864300000 // Hz
+#define TX_OUTPUT_POWER                                 70        // 14 dBm
 
 #if USE_MODEM_LORA == 1
 
@@ -154,9 +154,8 @@
 
 void transmit (void)
 {
-            strSize = sprintf ( str, "W=%10.4fkWh, cos fi=%5.4f, P1=%5.4f, S1=%5.4f", P, cosi, P1*1.41, S1*1.41);
-            State = TX;
-                     
+            strSize = sprintf ( str, "0001, %10.4f, %5.4f, %5.4f, %5.4f", P, cosi, P1*1.41, S1*1.41);
+            State=TX;
 }
 
 
@@ -244,7 +243,7 @@
         
     
         measure.attach_us(&meas, 200);
-        send.attach(&transmit, 30);
+        send.attach(&transmit, 10);
         
     while( 1 )
     {
@@ -266,26 +265,24 @@
         switch( State )
         {
         case RX:
-            
             //Radio.Rx( RX_TIMEOUT_VALUE );
             State = LOWPOWER;
             break;
         case TX:
-        
             strcpy(( char* )Buffer, ( char* ) str);
-                Radio.Send((uint8_t *) Buffer, BufferSize );
+            Radio.Send((uint8_t *) Buffer, BufferSize );
                 //Radio.Rx( RX_TIMEOUT_VALUE );
             State = LOWPOWER;
             break;
         case RX_TIMEOUT:
-            Radio.Rx( RX_TIMEOUT_VALUE );
+            //Radio.Rx( RX_TIMEOUT_VALUE );
             State = LOWPOWER;
             break;
         case RX_ERROR:
             State = LOWPOWER;
             break;
         case TX_TIMEOUT:
-            Radio.Rx( RX_TIMEOUT_VALUE );
+            //Radio.Rx( RX_TIMEOUT_VALUE );
             State = LOWPOWER;
             break;
         case LOWPOWER: