CSE_CircularBuffer is a simple circular buffer library from CIRCUITSTATE Electronics for the Arduino platform. It supports multiple data types and has most of the methods you will need.
This library is available from the official Arduino Library Manager. Open the Arduino IDE, search for "CSE_CircularBuffer" and install the latest version of the library.
Additionally, you can download the latest release package from the GitHub repository and install it manually. To do so, open the Arduino IDE, go to Sketch > Include Library > Add .ZIP Library… and select the downloaded file.
Another method is to clone the GitHub repository directly into your libraries folder. The development branch will have the latest features, bug fixes and other changes. To do so, navigate to your libraries folder (usually located at Documents/Arduino/libraries on Windows and ~/Documents/Arduino/libraries on macOS) and execute the following command:
git clone https://github.com/CIRCUITSTATE/CSE_CircularBuffer.git
Git should be installed in your computer.
The library can also be installed via PlatformIO. All officially listed Arduino listed libraries are automatically fetched by PlatformIO. Use the lib_deps search option to install the library.
This library does not have any external dependencies apart from the standard Arduino libraries.
- ADC-Average - This example shows how to read values through an ADC pin and store them in a circular buffer to find the average. This example uses the CSE_MillisTimer library for timing.
Please see the API.md file for the API reference.