#include <neoPixel.h>
#include <timeObj.h>


#define RING1_NUMPIXELS 7  // Number of pixels in Ring 1
#define RING2_NUMPIXELS 32 // Number of pixels in Ring 2
#define MS_FRAME        250 // Time in ms between color adjustments.


neoPixel      theLEDS(RING1_NUMPIXELS + RING2_NUMPIXELS,2);
colorMultiMap ourColorMap;
timeObj       frameTimer(MS_FRAME);
float         time;


void setup() {

  colorObj  initColor;

  ourColorMap.addColor(0,&black);   // Zero time, Darkest blue.
  ourColorMap.addColor(3,&black);   // Darkest blue.
  ourColorMap.addColor(10+3,&blue);
  ourColorMap.addColor(20+3,&white);
  theLEDS.begin();
  time = 0;
  initColor = ourColorMap.map(time);
  theLEDS.setAll(&initColor);
  theLEDS.show();
}

void loop() {
  
  colorObj thisColor;

  if (frameTimer.ding()) {
    time = time + MS_FRAME/1000.0;
    thisColor  = ourColorMap.map(time);
    theLEDS.setAll(&thisColor);
    theLEDS.show();
    frameTimer.stepTime();
  }
}