// Marc Miller, Jan 2016
#include "FastLED.h"
#define NUM_LEDS 30
#define dataPin 6
//CRGB leds[NUM_LEDS]; // Not using this. Using CRGBArray instead.
CRGBArray<NUM_LEDS> leds;
CRGBSet partA(leds(0,7)); // Define custom pixel range with a name.
CRGBSet partB(leds(8,15)); // Define custom pixel range with a name.
CHSV colorOne(0,222,255); // Define a custom color.
CHSV colorTwo(82,222,255); // Define a custom color.
//---------------------------------------------------------------
void setup() {
FastLED.addLeds<WS2812,dataPin>(leds,NUM_LEDS);
FastLED.setBrightness(255);
}
//---------------------------------------------------------------
void loop()
{
uint8_t sinBeat=beatsin8(300,0,NUM_LEDS-1,0,0);
/* fill_rainbow(leds, NUM_LEDS, millis()/10); // fill strip with moving rainbow.
//leds.fadeToBlackBy(230); // fade the whole strip down some.
partA = colorOne; // set partA pixel color.
partB = colorTwo; // set partB pixel color.
*/
leds[sinBeat]=CRGB::LightBlue;
fadeToBlackBy(leds,NUM_LEDS,110);
FastLED.show();
EVERY_N_SECONDS(3){ // Swaps the two custom colors every four seconds.
CHSV temp = colorOne;
colorOne = colorTwo;
colorTwo = temp;
}
}