MCPcopy Create free account
hub / github.com/FastLED/FastLED / setup

Function setup

examples/Multiple/ParallelOutputDemo/ParallelOutputDemo.h:61–88  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

59// IBCC<WS2811, 1, 16> outputs;
60
61void setup() {
62 delay(5000);
63 Serial.begin(57600);
64 Serial.println("Starting...");
65#if defined(HAS_PORTDC)
66 // Teensy 3 parallel output example using port controller backend.
67 //
68 // fastLED.addLeds<WS2811_PORTDC, NUM_STRIPS>(...) invokes the compiler
69 // to select and specialize the CWS2811Controller<> template for the
70 // PORTDC pin configuration. The template is instantiated with knowledge
71 // of which pins belong to which ports, enabling direct hardware register
72 // access with precise timing for all 16 parallel LED outputs.
73 //
74 // Alternative port controller options (commented out):
75 // FastLED.addLeds<WS2811_PORTA,NUM_STRIPS>(leds, NUM_LEDS_PER_STRIP);
76 // FastLED.addLeds<WS2811_PORTB,NUM_STRIPS>(leds, NUM_LEDS_PER_STRIP);
77 // FastLED.addLeds<WS2811_PORTD,NUM_STRIPS>(leds, NUM_LEDS_PER_STRIP).setCorrection(TypicalLEDStrip);
78 //
79 // Using PORTDC for 16-way parallel output (combined ports D and C):
80 FastLED.addLeds<WS2811_PORTDC,NUM_STRIPS>(leds, NUM_LEDS_PER_STRIP);
81#else
82 // NOTE: Parallel port output requires HAS_PORTDC support (Teensy 3.x only).
83 // Teensy 4.x does NOT support the WS2811_PORTDC style parallel output.
84 // For Teensy 4.x, use single-lane output on GPIO pins or consider
85 // alternative approaches for parallel LED control.
86 Serial.println("Parallel port output not supported on this platform");
87#endif
88}
89
90void loop() {
91 Serial.println("Loop....");

Callers

nothing calls this directly

Calls 3

delayFunction · 0.50
beginMethod · 0.45
printlnMethod · 0.45

Tested by

no test coverage detected