Advertisement
Guest User

Rhyno86_bookshelf.ino

a guest
Feb 11th, 2021
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 2.18 KB | None | 0 0
  1. // ArrayOfLedArrays - see https://github.com/FastLED/FastLED/wiki/Multiple-Controller-Examples for more info on
  2. // using multiple controllers.  In this example, we're going to set up three NEOPIXEL strips on three
  3. // different pins, each strip getting its own CRGB array to be played with, only this time they're going
  4. // to be all parts of an array of arrays.
  5.  
  6. #include <FastLED.h>
  7.  
  8. #define NUM_STRIPS 12
  9. #define NUM_LEDS_PER_STRIP 12
  10. CRGB leds[NUM_STRIPS][NUM_LEDS_PER_STRIP];
  11. uint8_t gBrightness = 128;
  12.  
  13. // For mirroring strips, all the "special" stuff happens just in setup.  We
  14. // just addLeds multiple times, once for each strip
  15. void setup() {
  16.   FastLED.addLeds<WS2812,  1, GRB>(leds[0], NUM_LEDS_PER_STRIP);
  17.   FastLED.addLeds<WS2812,  2, GRB>(leds[1], NUM_LEDS_PER_STRIP);
  18.   FastLED.addLeds<WS2812,  3, GRB>(leds[2], NUM_LEDS_PER_STRIP);
  19.   FastLED.addLeds<WS2812,  4, GRB>(leds[3], NUM_LEDS_PER_STRIP);
  20.   FastLED.addLeds<WS2812,  5, GRB>(leds[4], NUM_LEDS_PER_STRIP);
  21.   FastLED.addLeds<WS2812,  6, GRB>(leds[5], NUM_LEDS_PER_STRIP);
  22.   FastLED.addLeds<WS2812,  7, GRB>(leds[6], NUM_LEDS_PER_STRIP);
  23.   FastLED.addLeds<WS2812,  8, GRB>(leds[7], NUM_LEDS_PER_STRIP);
  24.   FastLED.addLeds<WS2812,  9, GRB>(leds[8], NUM_LEDS_PER_STRIP);
  25.   FastLED.addLeds<WS2812, 10, GRB>(leds[9], NUM_LEDS_PER_STRIP);
  26.   FastLED.addLeds<WS2812, 11, GRB>(leds[10], NUM_LEDS_PER_STRIP);
  27.   FastLED.addLeds<WS2812, 12, GRB>(leds[11], NUM_LEDS_PER_STRIP);
  28.   FastLED.setBrightness(gBrightness);
  29. }
  30.  
  31. void loop() {
  32.   fill_solid(leds[0],  NUM_LEDS_PER_STRIP, CRGB::Blue);
  33.   fill_solid(leds[1],  NUM_LEDS_PER_STRIP, CRGB::Green);
  34.   fill_solid(leds[2],  NUM_LEDS_PER_STRIP, CRGB::Brown);
  35.   fill_solid(leds[3],  NUM_LEDS_PER_STRIP, CRGB::White);
  36.   fill_solid(leds[4],  NUM_LEDS_PER_STRIP, CRGB::Indigo);
  37.   fill_solid(leds[5],  NUM_LEDS_PER_STRIP, CRGB::Red);
  38.   fill_solid(leds[6],  NUM_LEDS_PER_STRIP, CRGB::White);
  39.   fill_solid(leds[7],  NUM_LEDS_PER_STRIP, CRGB::Blue);
  40.   fill_solid(leds[8],  NUM_LEDS_PER_STRIP, CRGB::Green);
  41.   fill_solid(leds[9],  NUM_LEDS_PER_STRIP, CRGB::Yellow);
  42.   fill_solid(leds[10], NUM_LEDS_PER_STRIP, CRGB::Cyan);
  43.   fill_solid(leds[11], NUM_LEDS_PER_STRIP, CRGB::Purple);
  44.   FastLED.show();
  45. }
  46.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement