mirror of
https://github.com/richonguzman/LoRa_APRS_iGate.git
synced 2026-02-05 07:14:30 +01:00
wireless paper battery reading fix
This commit is contained in:
parent
8863838210
commit
9cc26ccdae
|
|
@ -136,7 +136,12 @@ namespace BATTERY_Utils {
|
|||
#if defined(HELTEC_V3) || defined(HELTEC_V2) || defined(HELTEC_WSL_V3) || defined(HELTEC_WP)
|
||||
digitalWrite(ADC_CTRL, HIGH);
|
||||
#endif
|
||||
|
||||
#ifdef HELTEC_WP
|
||||
double inputDivider = (1.0 / (10.0 + 10.0)) * 10.0; // The voltage divider is a 10k + 10k resistor in series
|
||||
#else
|
||||
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.
|
||||
#endif
|
||||
return (((sampleSum/100) * adcReadingTransformation) / inputDivider) + 0.285; // Yes, this offset is excessive, but the ADC on the ESP32s3 is quite inaccurate and noisy. Adjust to own measurements.
|
||||
#else
|
||||
#ifdef HAS_ADC_CALIBRATION
|
||||
|
|
|
|||
Loading…
Reference in a new issue