SpinKix

Corrected .... Compiles OK

Feb 15th, 2016
155
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.09 KB | None | 0 0
  1. #include "FastLED.h"
  2.  
  3. #define NUM_LEDS_PER_STRIP 80
  4. #define NUM_STRIPS 4
  5.  
  6. CRGB leds[NUM_LEDS_PER_STRIP];
  7. CLEDController *controllers[NUM_STRIPS];
  8. uint8_t gBrightness = 128;
  9.  
  10. void setup() {
  11. controllers[0] = &FastLED.addLeds<WS2812,1>(leds, NUM_LEDS_PER_STRIP);
  12. controllers[1] = &FastLED.addLeds<WS2812,2>(leds, NUM_LEDS_PER_STRIP);
  13. controllers[2] = &FastLED.addLeds<WS2812,10>(leds, NUM_LEDS_PER_STRIP);
  14. controllers[3] = &FastLED.addLeds<WS2812,11>(leds, NUM_LEDS_PER_STRIP);
  15. }
  16.  
  17. void loop() {
  18. // draw led data for the first strand into leds
  19. fill_solid(leds, NUM_LEDS_PER_STRIP, CRGB::Red);
  20. controllers[0]->showLeds(gBrightness);
  21.  
  22. // draw led data for the second strand into leds
  23. fill_solid(leds, NUM_LEDS_PER_STRIP, CRGB::Green);
  24. controllers[1]->showLeds(gBrightness);
  25.  
  26. // draw led data for the third strand into leds
  27. fill_solid(leds, NUM_LEDS_PER_STRIP, CRGB::Blue);
  28. controllers[2]->showLeds(gBrightness);
  29.  
  30. // draw led data for the first strand into leds
  31. fill_solid(leds, NUM_LEDS_PER_STRIP, CRGB::White);
  32. controllers[3]->showLeds(gBrightness);
  33. }
Advertisement
Add Comment
Please, Sign In to add comment