User Tools

Site Tools


en-us_commands:reference:analogreadavg

This is an old revision of the document!


analogReadAvg()

analogReadAvg() returns an integer average of multiple input values.

analogReadAvg command operation flow

int32_t analogReadAvg(uint8_t ch, uint8_t samples)

Commands

Command Arguments Return Value Operation
analogReadAvg(ch, samples) uint8_t ch
uint8_t samples — Number of averaging samples
int32_t Returns an integer average of multiple input values.

Example

int32_t value = analogReadAvg(0, 8);

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 A0 and MPAINO 0 do not identify the same physical input. Recheck arguments when changing product families.

← Built-in Command List

en-us_commands/reference/analogreadavg.1788785565.txt.gz · Last modified: by 127.0.0.1

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki