Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ArrayOfLedArrays - see https://github.com/FastLED/FastLED/wiki/Multiple-Controller-Examples for more info on
- // using multiple controllers. In this example, we're going to set up three NEOPIXEL strips on three
- // different pins, each strip getting its own CRGB array to be played with, only this time they're going
- // to be all parts of an array of arrays.
- #include <FastLED.h>
- #define NUM_STRIPS 12
- #define NUM_LEDS_PER_STRIP 12
- CRGB leds[NUM_STRIPS][NUM_LEDS_PER_STRIP];
- uint8_t gBrightness = 128;
- // For mirroring strips, all the "special" stuff happens just in setup. We
- // just addLeds multiple times, once for each strip
- void setup() {
- FastLED.addLeds<WS2812, 1, GRB>(leds[0], NUM_LEDS_PER_STRIP);
- FastLED.addLeds<WS2812, 2, GRB>(leds[1], NUM_LEDS_PER_STRIP);
- FastLED.addLeds<WS2812, 3, GRB>(leds[2], NUM_LEDS_PER_STRIP);
- FastLED.addLeds<WS2812, 4, GRB>(leds[3], NUM_LEDS_PER_STRIP);
- FastLED.addLeds<WS2812, 5, GRB>(leds[4], NUM_LEDS_PER_STRIP);
- FastLED.addLeds<WS2812, 6, GRB>(leds[5], NUM_LEDS_PER_STRIP);
- FastLED.addLeds<WS2812, 7, GRB>(leds[6], NUM_LEDS_PER_STRIP);
- FastLED.addLeds<WS2812, 8, GRB>(leds[7], NUM_LEDS_PER_STRIP);
- FastLED.addLeds<WS2812, 9, GRB>(leds[8], NUM_LEDS_PER_STRIP);
- FastLED.addLeds<WS2812, 10, GRB>(leds[9], NUM_LEDS_PER_STRIP);
- FastLED.addLeds<WS2812, 11, GRB>(leds[10], NUM_LEDS_PER_STRIP);
- FastLED.addLeds<WS2812, 12, GRB>(leds[11], NUM_LEDS_PER_STRIP);
- FastLED.setBrightness(gBrightness);
- }
- void loop() {
- fill_solid(leds[0], NUM_LEDS_PER_STRIP, CRGB::Blue);
- fill_solid(leds[1], NUM_LEDS_PER_STRIP, CRGB::Green);
- fill_solid(leds[2], NUM_LEDS_PER_STRIP, CRGB::Brown);
- fill_solid(leds[3], NUM_LEDS_PER_STRIP, CRGB::White);
- fill_solid(leds[4], NUM_LEDS_PER_STRIP, CRGB::Indigo);
- fill_solid(leds[5], NUM_LEDS_PER_STRIP, CRGB::Red);
- fill_solid(leds[6], NUM_LEDS_PER_STRIP, CRGB::White);
- fill_solid(leds[7], NUM_LEDS_PER_STRIP, CRGB::Blue);
- fill_solid(leds[8], NUM_LEDS_PER_STRIP, CRGB::Green);
- fill_solid(leds[9], NUM_LEDS_PER_STRIP, CRGB::Yellow);
- fill_solid(leds[10], NUM_LEDS_PER_STRIP, CRGB::Cyan);
- fill_solid(leds[11], NUM_LEDS_PER_STRIP, CRGB::Purple);
- FastLED.show();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement