duquesne9

Multistrip test

Mar 4th, 2019
444
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.16 KB | None | 0 0
  1. #include "FastLED.h"
  2. #define NUM_LEDS_PER_STRIP 9
  3. CRGB leftWallLeds[NUM_LEDS_PER_STRIP];
  4. CRGB rightWallLeds[NUM_LEDS_PER_STRIP];
  5. CRGB bottomLeds[NUM_LEDS_PER_STRIP];
  6. CRGB tempLED;
  7. byte hue = 0;
  8. byte counter=0;  
  9. int spark = 0;
  10. int sparkCheck = 0;
  11.  
  12. void setup() {
  13.   // put your setup code here, to run once:
  14.    FastLED.addLeds<NEOPIXEL, D3>(leftWallLeds, NUM_LEDS_PER_STRIP);
  15.   FastLED.addLeds<NEOPIXEL, D5>(rightWallLeds, NUM_LEDS_PER_STRIP);
  16.   FastLED.addLeds<NEOPIXEL, D7>(bottomLeds, NUM_LEDS_PER_STRIP);
  17.  
  18. }
  19.  
  20. void loop() {
  21.   // put your main code here, to run repeatedly:
  22.     hue++;
  23.   delay(random(20,40));
  24.   int i = random8(8);
  25.     leftWallLeds[i] = CHSV(random(1,15), 255, random(30,160));
  26.     rightWallLeds[i] = CHSV(random(15,25), 255, random(30,160));
  27.     bottomLeds[i] = CHSV(random(250,8), 255, random(30,160));
  28.      FastLED.show();
  29.  
  30.     delay(random(50,75));
  31.  
  32.      for(int x=0; x<NUM_LEDS_PER_STRIP; x++){
  33.     leftWallLeds[x].fadeToBlackBy(.5);
  34.      }
  35.      for(int x=0; x<NUM_LEDS_PER_STRIP; x++){
  36.     rightWallLeds[x].fadeToBlackBy(.5);
  37.      }
  38.      for(int x=0; x<NUM_LEDS_PER_STRIP; x++){
  39.     bottomLeds[x].fadeToBlackBy(.5);
  40.      }
  41.  
  42. }
Add Comment
Please, Sign In to add comment