14 const float binMin [32] = {-3, -0.4, 2.2, 4.8, 7.4, 10, 12.6, 15.2,
15 17.8, 20.4, 23, 25.6, 28.2, 30.8 ,33.4, 36,
16 41.2, 46.4, 51.6, 56.8, 62, 67.2, 73, 80.8,
17 88.6, 96.4, 104, 114.4, 124.8, 135, 148, 161};
35 for (
unsigned i = 1;
i < 32;
i++) {
43 if (fAdc < 128)
return mValues [fAdc];
49 if (fAdc % 32 == 31)
return 0.5 * (3 *
mValues [fAdc] -
mValues [fAdc - 1]);
56 if (fAdc >= 128 )
return 0;
57 if (fAdc == 127 )
return mValues [fAdc+1];
58 if (fAdc % 32 == 31)
return mValues [fAdc+3];
63 if (fAdc >= 32)
return false;
int adc(sample_type sample)
get the ADC sample (12 bits)
bool setLowEdges(const float fValue[32])
unsigned range(unsigned fAdc) const
float highEdge(unsigned fAdc) const
float center(unsigned fAdc) const
bool setLowEdge(float fValue, unsigned fAdc)
float lowEdge(unsigned fAdc) const