diff --git a/src/Lora_1W_APRS_Tracker.cpp b/src/Lora_1W_APRS_Tracker.cpp index 5d1348a..6104279 100644 --- a/src/Lora_1W_APRS_Tracker.cpp +++ b/src/Lora_1W_APRS_Tracker.cpp @@ -21,9 +21,9 @@ https://github.com/sh123/esp32_loraprs #define VERSION "2023.01.24" // BETA!!! -SX1268 radio = new Module(NSS, DIO1, NRST, BUSY); -HardwareSerial neo6m_gps(1); -TinyGPSPlus gps; +SX1268 radio = new Module(NSS, DIO1, NRST, BUSY); +HardwareSerial neo6m_gps(1); +TinyGPSPlus gps; OneButton UserButton1 = OneButton(BUTTON1_PIN, true, true); static bool send_update = true; @@ -33,11 +33,11 @@ void setup_lora_module() { radio.setOutputPower(Lora_Power); radio.setRfSwitchPins(RXEN, TXEN); if (state == RADIOLIB_ERR_NONE) { - Serial.println(F("LORA (1 Watt) MODULE Ready (Radiolib success!)")); - } else { - Serial.println(F("Lora Module Setup failed, code ")); - Serial.println(state); - } + Serial.println(F("LORA (1 Watt) MODULE Ready (Radiolib success!)")); + } else { + Serial.println(F("Lora Module Setup failed, code ")); + Serial.println(state); + } } void setup_gps_module() { @@ -46,7 +46,7 @@ void setup_gps_module() { static void ForcedBeaconTx() { Serial.println("Forced Beacon Tx"); - send_update = true; + send_update = true; } void setup() { @@ -58,7 +58,7 @@ void setup() { setup_gps_module(); UserButton1.attachClick(ForcedBeaconTx); WiFi.mode(WIFI_OFF); - btStop(); + btStop(); Serial.print("Version = "); Serial.println(VERSION); Serial.println("Transmission Start ---->"); @@ -99,11 +99,11 @@ void loop() { if (!send_update && gps_loc_update) { uint32_t lastTx = millis() - lastTxTime; currentHeading = gps.course.deg(); - lastTxDistance = TinyGPSPlus::distanceBetween(gps.location.lat(), gps.location.lng(), lastTxLatitude, lastTxLongitude); + lastTxDistance = TinyGPSPlus::distanceBetween(gps.location.lat(), gps.location.lng(), lastTxLatitude, lastTxLongitude); if (lastTx >= txInterval) { if (lastTxDistance > MinimumDistanceTx) { send_update = true; - } + } } if (!send_update) { double headingDelta = abs(previousHeading - currentHeading); @@ -207,12 +207,12 @@ void loop() { if (gps_time_update) { // updating txInterval between Slow and FastRate or in between int curr_speed = (int)gps.speed.kmph(); - if (curr_speed < SlowSpeed) { - txInterval = SlowRate * 1000; - } else if (curr_speed > FastSpeed) { - txInterval = FastRate * 1000; - } else { - txInterval = min(SlowRate, (FastSpeed * FastRate / curr_speed)) * 1000; - } - } + if (curr_speed < SlowSpeed) { + txInterval = SlowRate * 1000; + } else if (curr_speed > FastSpeed) { + txInterval = FastRate * 1000; + } else { + txInterval = min(SlowRate, (FastSpeed * FastRate / curr_speed)) * 1000; + } + } } \ No newline at end of file diff --git a/src/pins.h b/src/pins.h index 2effd86..0099ca9 100644 --- a/src/pins.h +++ b/src/pins.h @@ -34,7 +34,7 @@ RXD 17 21 ANTENA */ -#define LED_BUILTIN 2 // Blue Led ESP32 Pin +#define LED_BUILTIN 2 // Blue Led ESP32 Pin #define BUTTON1_PIN 15 // Forced Beacon Tx (Switch pin1 to pin 15 , Swith pin2 to 220 ohms resistor to GND) diff --git a/src/user_config.h b/src/user_config.h index 1fd3360..59b95c3 100644 --- a/src/user_config.h +++ b/src/user_config.h @@ -2,8 +2,8 @@ #define USER_CONFIG_H_ #define SRC_CALLSIGN "CD2RXU-7" // Change "CD2RXU-7" to your CALLSIGN-SSID you would use in APRS -#define DST_CALLSIGN "AP" // APRS Destination (could be also "WIDE1-1") -#define SYMBOL "[" // APRS Symbol: "[" Runner, "b" Bike, ">" Auto/Car +#define DST_CALLSIGN "AP" // APRS Destination (could be also "WIDE1-1") +#define SYMBOL "[" // APRS Symbol: "[" Runner, "b" Bike, ">" Auto/Car #define APRS_COMMENT "Lora Tracker 1W" // if you want to send any comment change the APRS_COMMENT // and also beacon_config.h > SendComment = true #endif \ No newline at end of file