#include <Arduino.h>

#include "LedCube.h"
#include "CubeAnimations.h"
CubeRegister out;
// new LedCube 5x5x5, 8 greytones
LedCube cube(5,8, out);

// new CubeAnimations with cube, speed (0-100%), duration in ms (default: 15000ms)
CubeAnimations animation(cube, 50, 5000);



void setup() {
  Serial.begin(115200);

  cube.framerate(30);
  cube.toSerial();
  delay(1000);
  cube.start();



  Serial.println("setup() done.");


}

//static const char *const messages[] = {"I°arduino", "make: something",
//                                        "einfach.machen.", "5x5x5 led-cube"};
//int message_count = 5;

void loop() {
  // int next_duration = random(10, 20);
  int ani = random(0,10);
  if (Serial){
    Serial.println("next Animation: " + String(ani));
  }
  switch (ani) {
  case 0:

    animation.glow();
    break;
  case 1:
    animation.glitter(40);
    break;
  case 2:
    animation.shaded_glitter(60);
    break;
  case 3:
    animation.dimed_glitter(70);
    break;
  case 4:

    break;
  case 5:

    break;
  case 6:

    break;
  case 7:

    break;

  }

};

/*
ISR(TIMER1_COMPA_vect) {

  cube.draw_layer();
};*/
