DivinerGregg

Untitled

Apr 26th, 2016
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.23 KB | None | 0 0
  1. // Marc Miller, Jan 2016
  2.  
  3. #include "FastLED.h"
  4. #define NUM_LEDS 14
  5.  
  6. //CRGB leds[NUM_LEDS]; // Not using this. Using CRGBArray instead.
  7. CRGBArray<NUM_LEDS> leds;
  8.  
  9. CRGBSet partA(leds(2,6)); // Define custom pixel range with a name.
  10. CRGBSet partB(leds(10,14)); // Define custom pixel range with a name.
  11.  
  12. CHSV colorOne(0,222,255); // Define a custom color.
  13. CHSV colorTwo(82,222,255); // Define a custom color.
  14.  
  15. //---------------------------------------------------------------
  16. void setup() {
  17. FastLED.addLeds<NEOPIXEL, 41>(leds, NUM_LEDS); //
  18. // FastLED.addLeds<LPD8806, 11, 13, GRB>(leds, NUM_LEDS);
  19. FastLED.setBrightness(255);
  20. fill_solid(leds, NUM_LEDS, CHSV(224, 250, 250));
  21. }
  22.  
  23. //---------------------------------------------------------------
  24. void loop()
  25. {
  26.  
  27. // fadeToBlackBy( leds, NUM_LEDS, 1);
  28. // fill_rainbow(leds, NUM_LEDS, millis()/10); // fill strip with moving rainbow.
  29. leds.fadeToBlackBy(NUM_LEDS); // fade the whole strip down some.
  30. partA = colorOne; // set partA pixel color.
  31. partB = colorTwo; // set partB pixel color.
  32. FastLED.show();
  33.  
  34. EVERY_N_SECONDS(4){ // Swaps the two custom colors every four seconds.
  35. CHSV temp = colorOne;
  36. colorOne = colorTwo;
  37. colorTwo = temp;
  38. }
  39. }
Advertisement
Add Comment
Please, Sign In to add comment