![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
asd
Revision 2:6554e96e4596, committed 2021-07-05
- Comitter:
- Madhouse226
- Date:
- Mon Jul 05 14:49:53 2021 +0000
- Parent:
- 1:ecd6c7ea3545
- Commit message:
- asd
Changed in this revision
main_pingpong.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main_pingpong.cpp Tue Oct 16 15:12:01 2018 +0000 +++ b/main_pingpong.cpp Mon Jul 05 14:49:53 2021 +0000 @@ -33,18 +33,18 @@ #define USE_MODEM_LORA 1 #define USE_MODEM_FSK !USE_MODEM_LORA -#define RF_FREQUENCY 868000000 // Hz +#define RF_FREQUENCY 869524963 // hz // 868000000 // Hz #define TX_OUTPUT_POWER 14 // 14 dBm #if USE_MODEM_LORA == 1 - #define LORA_BANDWIDTH LORA_BW_500 // [0: 125 kHz, + #define LORA_BANDWIDTH LORA_BW_125 // [0: 125 kHz, // 1: 250 kHz, // 2: 500 kHz, // 3: Reserved] #define LORA_SPREADING_FACTOR LORA_SF7 // [SF7..SF12] #define LORA_LOWDATARATEOPTIMIZE 0 - #define LORA_CODINGRATE LORA_CR_4_5 // [1: 4/5, + #define LORA_CODINGRATE LORA_CR_4_6 // [1: 4/5, // 2: 4/6, // 3: 4/7, // 4: 4/8] @@ -74,7 +74,7 @@ #endif #define RX_TIMEOUT_VALUE 3500 // in ms -#define BUFFER_SIZE 32 // Define the payload size here +#define BUFFER_SIZE 64 // Define the payload size here #if( defined ( TARGET_KL25Z ) || defined ( TARGET_LPC11U6X ) ) DigitalOut led( LED2 ); @@ -208,6 +208,8 @@ Ticker masterSendNextTicker; Ticker slaveListenNextTicker; +int counter = 0; + Serial serial(USBTX, USBRX); int main( void ) @@ -215,7 +217,8 @@ Radio.Reset(); Radio.Init(); serial.baud(115200); - SetToMaster(); +// SetToMaster(); + SetToSlave(); SetConfiguration(&radioConfiguration); ConfigureGeneralRadio(&Radio, &radioConfiguration); while(true){ @@ -237,7 +240,7 @@ PrepareBuffer(&Radio, messageToSend); ConfigureRadioTx(&Radio, &radioConfiguration); Radio.SetTx(radioConfiguration.txTimeout); - printf("Ping...\n"); + printf("Ping... %d\n", ++counter); State = WAIT_SEND_DONE; } break;