en-us_commands:reference:ianalogfilter
This is an old revision of the document!
Table of Contents
IanalogFilter()
IanalogFilter() applies a moving average to the supplied value.
int32_t IanalogFilter(uint8_t id, int32_t raw_value, uint8_t samples)
Commands
| Command | Arguments | Return Value | Operation |
|---|---|---|---|
IanalogFilter(id, raw_value, samples) | uint8_t id — Filter IDint32_t raw_value — New input valueuint8_t samples — Number of averaging samples | int32_t | Applies a moving average to the supplied value. |
Example
int32_t filtered = IanalogFilter(0, analogRead(A0), 10);
Precautions
- First check the supported channels and module DIP switch input ranges for the product.
- Do not use error constants as normal measurements.
- Increasing the sample count slows response and increases memory usage.
- MPINO
A0and MPAINO0do not identify the same physical input. Recheck arguments when changing product families.
en-us_commands/reference/ianalogfilter.1788785565.txt.gz · Last modified: by 127.0.0.1
