FastLED 3.9.15
Loading...
Searching...
No Matches
ArrayOfLedArrays.ino
// @filter: (board is not ATtiny1604)
// 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 3
#define NUM_LEDS_PER_STRIP 60
// For mirroring strips, all the "special" stuff happens just in setup. We
// just addLeds multiple times, once for each strip
void setup() {
// tell FastLED there's 60 NEOPIXEL leds on pin 2
FastLED.addLeds<NEOPIXEL, 2>(leds[0], NUM_LEDS_PER_STRIP);
// tell FastLED there's 60 NEOPIXEL leds on pin 3
FastLED.addLeds<NEOPIXEL, 3>(leds[1], NUM_LEDS_PER_STRIP);
// tell FastLED there's 60 NEOPIXEL leds on pin 4
FastLED.addLeds<NEOPIXEL, 4>(leds[2], NUM_LEDS_PER_STRIP);
}
void loop() {
// This outer loop will go over each strip, one at a time
for(int x = 0; x < NUM_STRIPS; x++) {
// This inner loop will go over each led in the current strip, one at a time
for(int i = 0; i < NUM_LEDS_PER_STRIP; i++) {
leds[x][i] = CRGB::Red;
FastLED.show();
delay(100);
}
}
}
void setup()
void loop()
fl::CRGB leds[NUM_LEDS]
#define NUM_LEDS_PER_STRIP
#define NUM_STRIPS
int x
Definition simple.h:92
FL_DISABLE_WARNING_PUSH FL_DISABLE_WARNING_GLOBAL_CONSTRUCTORS CFastLED FastLED
Global LED strip management instance.
fl::CRGB CRGB
Definition crgb.h:25
@ Red
<div style='background:#FF0000;width:4em;height:4em;'></div>
Definition crgb.h:622
@ Black
<div style='background:#000000;width:4em;height:4em;'></div>
Definition crgb.h:510