Skip to content

Commit

Permalink
HeltecWSL V3 battery reading fix
Browse files Browse the repository at this point in the history
  • Loading branch information
richonguzman committed Jun 21, 2024
1 parent f4bae74 commit 35e7970
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/battery_utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ namespace BATTERY_Utils {
int sample;
int sampleSum = 0;
#ifdef ADC_CTRL
#if defined(HELTEC_WSL_V3) || defined(HELTEC_WIRELESS_TRACKER)
#if defined(HELTEC_WIRELESS_TRACKER)
digitalWrite(ADC_CTRL, HIGH);
#endif
#if defined(HELTEC_V3) || defined(HELTEC_V2)
#if defined(HELTEC_V3) || defined(HELTEC_V2) || defined(HELTEC_WSL_V3)
digitalWrite(ADC_CTRL, LOW);
#endif
#endif
Expand All @@ -57,10 +57,10 @@ namespace BATTERY_Utils {
}

#ifdef ADC_CTRL
#if defined(HELTEC_WSL_V3) || defined(HELTEC_WIRELESS_TRACKER)
#if defined(HELTEC_WIRELESS_TRACKER)
digitalWrite(ADC_CTRL, LOW);
#endif
#if defined(HELTEC_V3) || defined(HELTEC_V2)
#if defined(HELTEC_V3) || defined(HELTEC_V2) || defined(HELTEC_WSL_V3)
digitalWrite(ADC_CTRL, HIGH);
#endif
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.
Expand Down

0 comments on commit 35e7970

Please sign in to comment.