Skip to content
Arduino library for smooth ADC results
Branch: master
Clone or download
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitignore Added support for Travis CI May 4, 2018
.travis.yml Removed deprecated sudo from .travis.yml Dec 11, 2018
Doxyfile Added support for Travis CI May 4, 2018 Added support for Travis CI May 4, 2018
LICENSE v0.3: fixed github issue #2 (timed action on 32b boards) Jul 3, 2017 Updated to status Dec 12, 2018 Added support for Travis CI May 4, 2018
keywords.txt v1.0: added tick resolution choice at init & Dosygen comments Nov 21, 2017 Fix broken url Jul 18, 2018

SmoothADC Build Status

Arduino library for smooth ADC results

The SmoothADC library helps filtering ADC values when smoother evolution of values is needed (getting rid of pikes for example). 4 values, average on mid ones.

I tried to keep the lib as tiny as possible.


  • Declare a SmoothADC instance (called adc below)
  • Initialize instance with adc.init(Pin, Resolution, Period)
    • Pin: adc pin
    • Resolution: timing resolution (us/ms)
    • Period: sample rate
  • adc.serviceADCPin(): Method to service the ADC pin when module is enabled (should be placed somewhere in the main loop)
  • adc.getADCVal(): Get the average ADC pin value (should replace usual analogRead)
  • adc.setPin(pin): Set ADC pin to service
  • adc.setResolution(resolution): Set Resolution of ADC pin to service (us/ms)
  • adc.setPeriod(period): Set sample rate of servicing
  • adc.getPin(): Get the serviced ADC pin
  • adc.getResolution(): Get the resolution for the serviced ADC pin
  • adc.getPeriod(): Get the sample rate of the serviced pin
  • adc.enable(): Enable ADC smoothing module
  • adc.disable(): Disable ADC smoothing module
  • adc.isEnabled(): Test if ADC smoothing is enabled
  • adc.isDisabled(): Test if ADC smoothing is disabled

Examples included

This example defines A0 & A1 (analog inputs) to be handled by SmoothADC library

Samples every 50ms for A0

Samples every 500us for A1

Every second, the average value from A0 & A1 are sent to serial port


Doxygen doc can be generated using "Doxyfile".

See generated documentation

Release Notes

See release notes

You can’t perform that action at this time.