Skip to content

Commit

Permalink
Added voltage divider and ADC input control pin for ARDUINO_heltec_wi…
Browse files Browse the repository at this point in the history
…fi_lora_32_V3
  • Loading branch information
matthias-bs committed Apr 27, 2024
1 parent 320b81d commit d6548fc
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions BresserWeatherSensorLWCfg.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@
// 20240410 Removed obsolete defines
// 20240413 Refactored ADC handling
// 20240423 Added define ARDUINO_heltec_wifi_lora_32_V3
// 20240427 Added voltage divider and ADC input control pin
// for ARDUINO_heltec_wifi_lora_32_V3
//
// Note:
// Depending on board package file date, either
Expand Down Expand Up @@ -465,6 +467,10 @@ const uint8_t ADC3_SAMPLES = 10;
// Voltage divider R1 / (R1 + R2) -> V_meas = V(R1 + R2); V_adc = V(R1)
#if defined(ARDUINO_THINGPULSE_EPULSE_FEATHER)
const float UBATT_DIV = 0.6812;
#elif defined(ARDUINO_heltec_wifi_32_lora_V3) || defined(ARDUINO_heltec_wifi_lora_32_V3)
#define ADC_CTRL 37
// R17=100k, R14=390k => 100k / (100k + 390 k)
const float UBATT_DIV = 0.2041;
#else
const float UBATT_DIV = 0.5;
#endif
Expand Down

0 comments on commit d6548fc

Please sign in to comment.