1 #include "BufferedVDivSampler.h" 2 #include "VIPCalculation.h" 8 const uint16_t periodMs,
9 const uint8_t samples) :
19 return vDivVolts(
average(), _r1KOhm, _r2KOhm, _vRef);
24 return vDivVolts(
last(), _r1KOhm, _r2KOhm, _vRef);
virtual int16_t last()
Get the most recent sample value.
virtual float averageVolts()
Get the mean value in the sample set.
virtual float lastVolts()
Get the most recent voltage value.
BufferedVDivSampler(const uint8_t pin, const uint16_t r1KOhm, const uint16_t r2KOhm, const float vRef=5.0, const uint16_t periodMs=10, const uint8_t samples=10)
Ringbuffer-based sampler for analog values.
virtual float average()
Get the mean value in the sample set.