en-us_commands:reference:analogreadavgf
This is an old revision of the document!
Table of Contents
analogReadAvgf()
analogReadAvgf() returns a floating-point average of multiple input values.
float analogReadAvgf(uint8_t ch, uint8_t samples)
Commands
| Command | Arguments | Return Value | Operation |
|---|---|---|---|
analogReadAvgf(ch, samples) | uint8_t chuint8_t samples — Number of averaging samples | float | Returns a floating-point average of multiple input values. |
Example
float value = analogReadAvgf(0, 8); Serial.println(value, 2);
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/analogreadavgf.1788785565.txt.gz · Last modified: by 127.0.0.1
