/*KDK designs Music Box
 * Addressable LED array code
 * Code credit to https://create.arduino.cc/projecthub/talofer99/arduino-and-addressable-led-b8403f
 * Edited by: Kiernan Canavan
*/
// include library
#include<FastLED.h>

//define number of LED and pin
#define NUM_LEDS 8
#define DATA_PIN 5

// create the ld object array
CRGB leds[NUM_LEDS];

// define 3 byte for the random color
byte  r, g, b;

void setup() {
  // init the LED object
  FastLED.addLeds<NEOPIXEL, DATA_PIN>(leds, NUM_LEDS);
  // set random seed
  randomSeed(analogRead(0));
  int soundAmp;
  //Get data from sound output amplitude and parse it into a 0-127
}


void loop() {
  // loop over the NUM_LEDS
  for (int cur = 0; cur < NUM_LEDS; cur++) {
    // chose random value for the r/g/b
    r = random(0, 127) + soundAmp;
    g = random(0, 127) + soundAmp;
    b = random(0, 127) + soundAmp;

    //set the value to the led
    leds[cur] = CRGB (r, g, b);

    // set the colors set into the phisical LED
    FastLED.show();

    // delay 50 millis
    FastLED.delay(200);
  }


}