diff --git a/firmware/analog_input.cpp b/firmware/analog_input.cpp index 803e075..cb2b2fa 100644 --- a/firmware/analog_input.cpp +++ b/firmware/analog_input.cpp @@ -25,7 +25,9 @@ static float AverageSamples(adcsample_t* buffer, size_t idx) idx += ADC_OVERSAMPLE; } - return (float)sum / ADC_OVERSAMPLE; + constexpr float scale = 3.3f / (2048 * ADC_OVERSAMPLE); + + return (float)sum * scale; } AnalogResult AnalogSample()