Skip to content

jacobrosenthal/StreamBuffer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

#StreamBuffer

Arduino Stream object that buffers data. You'll need to download and import ringbuffer as well. By creating a second StreamBuffer object reversing the read and write ringbuffers you can allows read what the other StreamBuffer writes.

##Install As usual, download zip, unzip and rename to remove the dash character and place in your Arduino Libraries folder, on MacOSX ~/Documents/Arduino/libraries/

##Use Create a StreamBuffer.

#include <StreamBuffer.h>
#include <ringbuffer.h>

ringbuffer rx(50);
ringbuffer tx(50);
StreamBuffer stream(rx,tx);
StreamBuffer externalaccess(tx,rx);

Now you can do all the usual read/writey stuff to stream and get that data out from externalaccess

stream.write('a');
char c = externalaccess.read(); // 'a'

About

Arduino Stream object that buffers data.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages