FastLED 3.9.15
Loading...
Searching...
No Matches
ArrayOfLedArrays.ino
Go to the documentation of this file.
1
4
5// @filter: (board is not ATtiny1604)
6
7// ArrayOfLedArrays - see https://github.com/FastLED/FastLED/wiki/Multiple-Controller-Examples for more info on
8// using multiple controllers. In this example, we're going to set up three NEOPIXEL strips on three
9// different pins, each strip getting its own CRGB array to be played with, only this time they're going
10// to be all parts of an array of arrays.
11
12#include <FastLED.h>
13
14#define NUM_STRIPS 3
15#define NUM_LEDS_PER_STRIP 60
17
18// For mirroring strips, all the "special" stuff happens just in setup. We
19// just addLeds multiple times, once for each strip
20void setup() {
21 // tell FastLED there's 60 NEOPIXEL leds on pin 2
22 FastLED.addLeds<NEOPIXEL, 2>(leds[0], NUM_LEDS_PER_STRIP);
23
24 // tell FastLED there's 60 NEOPIXEL leds on pin 3
25 FastLED.addLeds<NEOPIXEL, 3>(leds[1], NUM_LEDS_PER_STRIP);
26
27 // tell FastLED there's 60 NEOPIXEL leds on pin 4
28 FastLED.addLeds<NEOPIXEL, 4>(leds[2], NUM_LEDS_PER_STRIP);
29
30}
31
32void loop() {
33 // This outer loop will go over each strip, one at a time
34 for(int x = 0; x < NUM_STRIPS; x++) {
35 // This inner loop will go over each led in the current strip, one at a time
36 for(int i = 0; i < NUM_LEDS_PER_STRIP; i++) {
37 leds[x][i] = CRGB::Red;
38 FastLED.show();
39 leds[x][i] = CRGB::Black;
40 delay(100);
41 }
42 }
43}
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