diff --git a/platformio.ini b/platformio.ini index 7ddca7e..f8a68c2 100644 --- a/platformio.ini +++ b/platformio.ini @@ -1,21 +1,11 @@ -; PlatformIO Project Configuration File -; -; Build options: build flags, source filter -; Upload options: custom upload port, speed and extra flags -; Library options: dependencies, extra library storages -; Advanced options: extra scripting -; -; Please visit documentation for the other options and examples -; https://docs.platformio.org/page/projectconf.html - -[platformio] -default_envs = ttgo-t-beam - -[env:ttgo-t-beam] +[env] platform = espressif32 -board = ttgo-t-beam framework = arduino +board = ttgo-t-beam lib_ldf_mode = deep+ +monitor_speed = 115200 + +[env:ttgo-t-beam-v1] lib_deps = Adafruit GFX Library Adafruit SSD1306 @@ -23,4 +13,13 @@ lib_deps = APRS-Decoder-Lib TinyGPSPlus AXP202X_Library -monitor_speed = 115200 + +[env:ttgo-t-beam-v0_7] +lib_deps = + Adafruit GFX Library + Adafruit SSD1306 + LoRa + APRS-Decoder-Lib + APRS-IS-Lib + TinyGPSPlus +build_flags = -DARDUINO_T_Beam_V0_7 diff --git a/src/LoRa_APRS_Tracker.cpp b/src/LoRa_APRS_Tracker.cpp index 9453b7f..5c9451d 100644 --- a/src/LoRa_APRS_Tracker.cpp +++ b/src/LoRa_APRS_Tracker.cpp @@ -1,21 +1,30 @@ #include #include #include +#if !defined(ARDUINO_T_Beam_V0_7) #include +#endif #include #include "settings.h" #include "display.h" +#if !defined(ARDUINO_T_Beam_V0_7) #define RXPin 12 #define TXPin 34 +#else +#define RXPin 15 +#define TXPin 12 +#endif void setup_lora(); String create_lat_aprs(RawDegrees lat); String create_long_aprs(RawDegrees lng); HardwareSerial ss(1); +#if !defined(ARDUINO_T_Beam_V0_7) AXP20X_Class axp; +#endif TinyGPSPlus gps; int next_update = -1; @@ -28,6 +37,7 @@ void setup() Serial.println("[INFO] LoRa APRS Tracker by OE5BPA (Peter Buchegger)"); show_display("OE5BPA", "LoRa APRS Tracker", "by Peter Buchegger", 2000); +#if !defined(ARDUINO_T_Beam_V0_7) Wire.begin(SDA, SCL); if (!axp.begin(Wire, AXP192_SLAVE_ADDRESS)) { @@ -39,6 +49,7 @@ void setup() axp.setPowerOutPut(AXP192_LDO3, AXP202_ON); // GPS axp.setPowerOutPut(AXP192_DCDC1, AXP202_ON); // OLED axp.setDCDC1Voltage(3300); +#endif ss.begin(9600, SERIAL_8N1, TXPin, RXPin);