FastLED 3.7.8
Loading...
Searching...
No Matches
ParallelOutputDemo.ino
Go to the documentation of this file.
1
4
5#include <FastLED.h>
6
7#define NUM_LEDS_PER_STRIP 16
8// Note: this can be 12 if you're using a teensy 3 and don't mind soldering the pads on the back
9#define NUM_STRIPS 16
10
11CRGB leds[NUM_STRIPS * NUM_LEDS_PER_STRIP];
12
13// Pin layouts on the teensy 3/3.1:
14// WS2811_PORTD: 2,14,7,8,6,20,21,5
15// WS2811_PORTC: 15,22,23,9,10,13,11,12,28,27,29,30 (these last 4 are pads on the bottom of the teensy)
16// WS2811_PORTDC: 2,14,7,8,6,20,21,5,15,22,23,9,10,13,11,12 - 16 way parallel
17//
18// Pin layouts on the due
19// WS2811_PORTA: 69,68,61,60,59,100,58,31 (note: pin 100 only available on the digix)
20// WS2811_PORTB: 90,91,92,93,94,95,96,97 (note: only available on the digix)
21// WS2811_PORTD: 25,26,27,28,14,15,29,11
22//
23
24
25// IBCC<WS2811, 1, 16> outputs;
26
27void setup() {
28 delay(5000);
29 Serial.begin(57600);
30 Serial.println("Starting...");
31 // FastLED.addLeds<WS2811_PORTA,NUM_STRIPS>(leds, NUM_LEDS_PER_STRIP);
32 // FastLED.addLeds<WS2811_PORTB,NUM_STRIPS>(leds, NUM_LEDS_PER_STRIP);
33 // FastLED.addLeds<WS2811_PORTD,NUM_STRIPS>(leds, NUM_LEDS_PER_STRIP).setCorrection(TypicalLEDStrip);
34 FastLED.addLeds<WS2811_PORTDC,NUM_STRIPS>(leds, NUM_LEDS_PER_STRIP);
35
36 // Teensy 4 parallel output example
37 // FastLED.addLeds<NUM_STRIPS, WS2811, 1>(leds,NUM_LEDS_PER_STRIP);
38}
39
40void loop() {
41 Serial.println("Loop....");
42 static uint8_t hue = 0;
43 for(int i = 0; i < NUM_STRIPS; i++) {
44 for(int j = 0; j < NUM_LEDS_PER_STRIP; j++) {
45 leds[(i*NUM_LEDS_PER_STRIP) + j] = CHSV((32*i) + hue+j,192,255);
46 }
47 }
48
49 // Set the first n leds on each strip to show which strip it is
50 for(int i = 0; i < NUM_STRIPS; i++) {
51 for(int j = 0; j <= i; j++) {
52 leds[(i*NUM_LEDS_PER_STRIP) + j] = CRGB::Red;
53 }
54 }
55
56 hue++;
57
58 FastLED.show();
59 // FastLED.delay(100);
60}
CFastLED FastLED
Global LED strip management instance.
Definition FastLED.cpp:21
central include file for FastLED, defines the CFastLED class/object
void show(uint8_t scale)
Update all our controllers with the current led colors, using the passed in brightness.
Definition FastLED.cpp:59
static CLEDController & addLeds(CLEDController *pLed, struct CRGB *data, int nLedsOrOffset, int nLedsIfOffset=0)
Add a CLEDController instance to the world.
Definition FastLED.cpp:47
@ Red
Definition crgb.h:580
Representation of an HSV pixel (hue, saturation, value (aka brightness)).
Definition chsv.h:11
Representation of an RGB pixel (Red, Green, Blue)
Definition crgb.h:25