Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/AlexGyver/Arduino_Ambilight.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'Библиотеки/FastLED-master/examples/Multiple/ArrayOfLedArrays/ArrayOfLedArrays.ino')
-rw-r--r--Библиотеки/FastLED-master/examples/Multiple/ArrayOfLedArrays/ArrayOfLedArrays.ino37
1 files changed, 37 insertions, 0 deletions
diff --git a/Библиотеки/FastLED-master/examples/Multiple/ArrayOfLedArrays/ArrayOfLedArrays.ino b/Библиотеки/FastLED-master/examples/Multiple/ArrayOfLedArrays/ArrayOfLedArrays.ino
new file mode 100644
index 0000000..b2b115e
--- /dev/null
+++ b/Библиотеки/FastLED-master/examples/Multiple/ArrayOfLedArrays/ArrayOfLedArrays.ino
@@ -0,0 +1,37 @@
+// 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
+CRGB leds[NUM_STRIPS][NUM_LEDS_PER_STRIP];
+
+// 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 10
+ FastLED.addLeds<NEOPIXEL, 10>(leds[0], NUM_LEDS_PER_STRIP);
+
+ // tell FastLED there's 60 NEOPIXEL leds on pin 11
+ FastLED.addLeds<NEOPIXEL, 11>(leds[1], NUM_LEDS_PER_STRIP);
+
+ // tell FastLED there's 60 NEOPIXEL leds on pin 12
+ FastLED.addLeds<NEOPIXEL, 12>(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();
+ leds[x][i] = CRGB::Black;
+ delay(100);
+ }
+ }
+}