Skip to content

Simple implementation of Arduino FIFO buffer / queue.

Notifications You must be signed in to change notification settings

TeamSunride/FIFObuffer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FIFObuffer

Simple FIFO buffer designed for use with an Arduino

Adapted from Arduino-FIFO by Daniel Eisterhold

Changes made:

  • Added extra methods
  • You can change the type and size of the buffer

Explanation

https://en.wikipedia.org/wiki/FIFO_(computing_and_electronics)

FIFO queue image

(image credit Vegpuff/Wikipedia)

Example

#include "FIFObuffer.h"
#include "iostream"

int main(int args, char **argv) {
    FIFObuffer<int, 3> buffer;
    buffer.put(1);
    buffer.put(2);
    buffer.put(3);
    std::cout << buffer.sum() << "\n";  // outputs 6
}

About

Simple implementation of Arduino FIFO buffer / queue.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published