mirror of https://github.com/rusefi/wideband.git
scale properly to volts
This commit is contained in:
parent
1fca955973
commit
684760babd
|
@ -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()
|
||||
|
|
Loading…
Reference in New Issue