Skip to content

Commit

Permalink
testing heltec v2 tnc
Browse files Browse the repository at this point in the history
  • Loading branch information
richonguzman committed Dec 9, 2024
1 parent 5e6c80d commit 5d06ce3
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/power_utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ namespace POWER_Utils {
#ifdef HELTEC_WIRELESS_TRACKER
digitalWrite(ADC_CTRL, HIGH);
#endif
#if defined(HELTEC_V3_GPS) || defined(HELTEC_V3_TNC)|| defined(HELTEC_V2_GPS) || defined(HELTEC_V2_GPS_915) || defined(HELTEC_WSL_V3_GPS_DISPLAY)
#if defined(HELTEC_V3_GPS) || defined(HELTEC_V3_TNC)|| defined(HELTEC_V2_GPS) || defined(HELTEC_V2_GPS_915) || defined(HELTEC_V2_TNC) || defined(HELTEC_WSL_V3_GPS_DISPLAY)
digitalWrite(ADC_CTRL, LOW);
#endif
#endif
Expand All @@ -68,7 +68,7 @@ namespace POWER_Utils {
#ifdef HELTEC_WIRELESS_TRACKER
digitalWrite(ADC_CTRL, LOW);
#endif
#if defined(HELTEC_V3_GPS) || defined(HELTEC_V3_TNC) || defined(HELTEC_V2_GPS) || defined(HELTEC_V2_GPS_915) || defined(HELTEC_WSL_V3_GPS_DISPLAY)
#if defined(HELTEC_V3_GPS) || defined(HELTEC_V3_TNC) || defined(HELTEC_V2_GPS) || defined(HELTEC_V2_GPS_915) || defined(HELTEC_V2_TNC) || defined(HELTEC_WSL_V3_GPS_DISPLAY)
digitalWrite(ADC_CTRL, HIGH);
#endif
batteryMeasurmentTime = millis();
Expand All @@ -84,7 +84,7 @@ namespace POWER_Utils {
double inputDivider = (1.0 / (390.0 + 100.0)) * 100.0; // The voltage divider is a 390k + 100k resistor in series, 100k on the low side.
return (voltage / inputDivider) + 0.285; // Yes, this offset is excessive, but the ADC on the ESP32s3 is quite inaccurate and noisy. Adjust to own measurements.
#endif
#if defined(HELTEC_V2_GPS) || defined(HELTEC_V2_GPS_915)
#if defined(HELTEC_V2_GPS) || defined(HELTEC_V2_GPS_915) || defined(HELTEC_V2_TNC)
double inputDivider = (1.0 / (220.0 + 100.0)) * 100.0; // The voltage divider is a 390k + 100k resistor in series, 100k on the low side.
return (voltage / inputDivider) + 0.285; // Yes, this offset is excessive, but the ADC on the ESP32s3 is quite inaccurate and noisy. Adjust to own measurements.
#endif
Expand Down
2 changes: 1 addition & 1 deletion variants/heltec-lora32-v2_GPS/platformio.ini
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[env:heltec-lora32-v2_GPS]
extends = env:esp32
board = ttgo-lora32-v21
board = heltec_wifi_lora_32_V2
build_flags =
${common.build_flags}
-D HELTEC_V2_GPS
Expand Down
2 changes: 1 addition & 1 deletion variants/heltec-lora32-v2_GPS_915/platformio.ini
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[env:heltec-lora32-v2_GPS_915]
extends = env:esp32
board = ttgo-lora32-v21
board = heltec_wifi_lora_32_V2
build_flags =
${common.build_flags}
-D HELTEC_V2_GPS_915
Expand Down
34 changes: 34 additions & 0 deletions variants/heltec-lora32-v2_TNC/board_pinout.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#ifndef BOARD_PINOUT_H_
#define BOARD_PINOUT_H_

// LoRa Radio
#define HAS_SX1278
#define RADIO_SCLK_PIN 5
#define RADIO_MISO_PIN 19
#define RADIO_MOSI_PIN 27
#define RADIO_CS_PIN 18
#define RADIO_RST_PIN 14
#define RADIO_BUSY_PIN 26

// Display
#undef OLED_SDA
#undef OLED_SCL
#undef OLED_RST

#define OLED_SDA 4
#define OLED_SCL 15
#define OLED_RST 16

// GPS
#define HAS_NO_GPS
#define GPS_RX -1
#define GPS_TX -1

// OTHER
#define BATTERY_PIN 37
#define BUTTON_PIN 0
#define ADC_CTRL 21

#define HAS_BT_CLASSIC

#endif
9 changes: 9 additions & 0 deletions variants/heltec-lora32-v2_TNC/platformio.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[env:heltec-lora32-v2_TNC]
extends = env:esp32
board = heltec_wifi_lora_32_V2
build_flags =
${common.build_flags}
-D HELTEC_V2_TNC
lib_deps =
${common.lib_deps}
${common.display_libs}

0 comments on commit 5d06ce3

Please sign in to comment.