move constant variables to config header

This commit is contained in:
Peter Buchegger 2020-06-03 21:23:17 +02:00
parent cd3629f18e
commit 8a4ec5061b
2 changed files with 12 additions and 10 deletions

View file

@ -60,9 +60,7 @@ void setup()
APRSMessage msg;
msg.setSource(USER);
msg.setDestination("APLG0");
char body_char[100];
sprintf(body_char, "=%sI%s&%s", BEACON_LAT_POS, BEACON_LONG_POS, BEACON_MESSAGE);
msg.getAPRSBody()->setData(String(body_char));
msg.getAPRSBody()->setData(String("=") + BEACON_LAT_POS + "I" + BEACON_LONG_POS + "&" + BEACON_MESSAGE);
BeaconMsg = msg.encode();
delay(500);
@ -221,17 +219,16 @@ void setup_lora()
LoRa.setPins(LORA_CS, LORA_RST, LORA_IRQ);
Serial.println("[INFO] Set LoRa pins!");
long freq = 433775000;
Serial.print("[INFO] frequency: ");
Serial.println(freq);
if (!LoRa.begin(freq)) {
Serial.println(LORA_FREQUENCY);
if (!LoRa.begin(LORA_FREQUENCY)) {
Serial.println("[ERROR] Starting LoRa failed!");
show_display("ERROR", "Starting LoRa failed!");
while (1);
}
LoRa.setSpreadingFactor(12);
LoRa.setSignalBandwidth(125E3);
LoRa.setCodingRate4(5);
LoRa.setSpreadingFactor(LORA_SPREADING_FACTOR);
LoRa.setSignalBandwidth(LORA_SIGNAL_BANDWIDTH);
LoRa.setCodingRate4(LORA_CODING_RATE4);
LoRa.enableCrc();
Serial.println("[INFO] LoRa init done!");
show_display("INFO", "LoRa init done!", 2000);

View file

@ -17,11 +17,16 @@
//#define SERVER "euro.aprs2.net"
#define PORT 14580
#define BEACON_TIMEOUT 15
#define BEACON_TIMEOUT (15)
#define BEACON_LAT_POS "4819.82N"
#define BEACON_LONG_POS "01418.68E"
#define BEACON_MESSAGE "LoRa IGATE (RX only), Info: github.com/peterus/LoRa_APRS_iGate"
#define LORA_FREQUENCY (433775000)
#define LORA_SPREADING_FACTOR (12)
#define LORA_SIGNAL_BANDWIDTH (125E3)
#define LORA_CODING_RATE4 (5)
//#define ARDUINO_T_Beam_V0_7
#endif