💾 Installation
- Clone the repository and download the zip file at https://github.com/AlexandreHiroyuki/MovingAverage_ArduinoLibrary. Also, you can see and download all releases at https://github.com/AlexandreHiroyuki/MovingAverage_ArduinoLibrary/releases.
- Drag and drop it on
Arduino/libraries/
folder. - Include it on your code.
#include <MovingAveragePlus.h>
You can also download and install the library through the official library manager on the Arduino IDE https://www.arduino.cc/reference/en/libraries/movingaverageplus/. Access https://www.arduino.cc/en/guide/libraries to see more details about installing libraries on Arduino IDE.
Another site that lists Arduino libraries accepted by the official library manager https://www.arduinolibraries.info/libraries/moving-average-plus.
—Recommended Platform— Now it's possible to install this library on the PlatformIO Registry!
💡 Getting Started
- You can easily try out the library by running the example code.
- Just open the subfolder
MovingAverage_ArduinoLibrary/examples/
. - Then try compiling the
moving_average_print.ino
. - Open the serial monitor.
- Then see the array magically moving and calculating it average!
📦 Moving Average+ Methods
The MovingAveragePlus class abstracts the implementation of a circular array in order to calculate the arithmetic average of its members. Because it is a circular array, the next input will replace the oldest element (represented by the first index), so it is also possible to call it a FIFO queue.
If you are used to the C++ Standard Library, it will be easier to learn the methods since they follow the same pattern of name and logic.
Click on the link below to see more about the class methods.