Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Marc Miller, Jan 2016
- #include "FastLED.h"
- #define NUM_LEDS 14
- //CRGB leds[NUM_LEDS]; // Not using this. Using CRGBArray instead.
- CRGBArray<NUM_LEDS> leds;
- CRGBSet partA(leds(2,6)); // Define custom pixel range with a name.
- CRGBSet partB(leds(10,14)); // 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<NEOPIXEL, 41>(leds, NUM_LEDS); //
- // FastLED.addLeds<LPD8806, 11, 13, GRB>(leds, NUM_LEDS);
- FastLED.setBrightness(255);
- fill_solid(leds, NUM_LEDS, CHSV(224, 250, 250));
- }
- //---------------------------------------------------------------
- void loop()
- {
- // fadeToBlackBy( leds, NUM_LEDS, 1);
- // fill_rainbow(leds, NUM_LEDS, millis()/10); // fill strip with moving rainbow.
- leds.fadeToBlackBy(NUM_LEDS); // fade the whole strip down some.
- partA = colorOne; // set partA pixel color.
- partB = colorTwo; // set partB pixel color.
- FastLED.show();
- EVERY_N_SECONDS(4){ // Swaps the two custom colors every four seconds.
- CHSV temp = colorOne;
- colorOne = colorTwo;
- colorTwo = temp;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment