User`s manual
RabbitFLEX User’s Manual www.rabbit.com 95
flexAnaInAverageSetting
int flexAnaInAverageSetting(Flex_IOPin *pin, float alpha);
DESCRIPTION
Sets the averaging alpha value (weight value) for a given ADC channel to read averaged ADC
data. To read the average ADC data use the following functions:
• flexAnaInAverage() - read averaged raw data
• flexAnaInVoltsAverage() - read averaged voltage
• flexAnaInmAmpsAverage() - read averaged current
If you set the alpha value to 1 for a given A/D channel, then you will get the actual unaltered
raw data value.
This function is non-reentrant.
PARAMETERS
pin Pointer to the information structure for the selected pin.
alpha Value for averaging the given analog input channel; the recommended range
is 0.001–1.0.
RETURN VALUE
0: success
-1: invalid alpha value
-2: error (not an analog input?)
SEE ALSO
flexAnaInAverage, flexAnaInVoltsAverage, flexAnaInmAmpsAverage