#include "textBuff.h"  // <- Special version with peekIndex() so we can do the output.

// It has two pointers head n' tail. It jusrt moves them around
// a ring buffer. The only dynamic memory bit is the initial
// allocation of the buffer.


#define NUM_BYTES 6

textBuff theBuff(NUM_BYTES,true);
int theCharVal;

void setup() {
  
  Serial.begin(9600);
  theCharVal = int('a');
}




void loop() {

  theBuff.addChar((char)theCharVal);
  theCharVal++;
  if (theCharVal>(char)'z') theCharVal = int('a');
  for (int i = 0;i<NUM_BYTES;i++) {
    Serial.print(theBuff.peekIndex(i));
  }
  Serial.print("\n\n\n\n\n\n\n");
  if (theBuff.full()) {
    theBuff.readChar();
  }
  delay(1000);
}