Update examples

This commit is contained in:
lewisxhe 2025-05-10 14:25:50 +08:00
commit 2e9042861e
3 changed files with 25 additions and 9 deletions

View file

@ -3,18 +3,18 @@
#include "LoRaBoards.h"
#ifndef CONFIG_RADIO_FREQ
#define CONFIG_RADIO_FREQ 868.0
#define CONFIG_RADIO_FREQ 868.0
#endif
#ifndef CONFIG_RADIO_OUTPUT_POWER
#define CONFIG_RADIO_OUTPUT_POWER 17
#define CONFIG_RADIO_OUTPUT_POWER 17
#endif
#ifndef CONFIG_RADIO_BW
#define CONFIG_RADIO_BW 125.0
#define CONFIG_RADIO_BW 125.0
#endif
#if !defined(USING_SX1276) && !defined(USING_SX1278)
#error "LoRa example is only allowed to run SX1276/78. For other RF models, please run examples/RadioLibExamples
#error "LoRa example is only allowed to run SX1276/78. For other RF models, please run examples/RadioLibExamples
#endif
void setup()
@ -30,6 +30,14 @@ void setup()
digitalWrite(RADIO_TCXO_ENABLE, HIGH);
#endif
#ifdef RADIO_CTRL
Serial.println("Turn on LAN, Enter Rx mode.");
/*
* BPF LoRa LAN Control ,set HIGH turn on LAN ,RX Mode
* */
digitalWrite(RADIO_CTRL, HIGH);
#endif /*RADIO_CTRL*/
LoRa.setPins(RADIO_CS_PIN, RADIO_RST_PIN, RADIO_DIO0_PIN);
if (!LoRa.begin(CONFIG_RADIO_FREQ * 1000000)) {
Serial.println("Starting LoRa failed!");