Define ADC_MULTIPLIER for adjustable ADC calculation

This commit is contained in:
Snayler
2026-03-27 01:17:39 +00:00
committed by GitHub
parent 517f2f1efd
commit 50e9456f28

View File

@@ -11,6 +11,9 @@
#ifndef PIN_ADC_CTRL // set in platformio.ini for Heltec Wireless Tracker (2)
#define PIN_ADC_CTRL 37
#endif
#ifndef ADC_MULTIPLIER //default ADC multiplier
#define ADC_MULTIPLIER 5.42
#endif
#define PIN_ADC_CTRL_ACTIVE LOW
#define PIN_ADC_CTRL_INACTIVE HIGH
@@ -88,7 +91,7 @@ public:
digitalWrite(PIN_ADC_CTRL, !adc_active_state);
return (5.42 * (3.3 / 1024.0) * raw) * 1000;
return (ADC_MULTIPLIER * (3.3 / 1024.0) * raw) * 1000;
}
const char* getManufacturerName() const override {