FastLED 3.9.15
Loading...
Searching...
No Matches

◆ add() [5/8]

fl::vector< fl::ChannelPtr > CFastLED::add ( fl::initializer_list< fl::ChannelConfig > configs)
static

Add multiple LED channels from an initializer list.

Creates and registers multiple Channel-based LED controllers from a brace-enclosed list. Returns a vector of shared_ptrs for lifetime control.

Parameters
configsInitializer list of ChannelConfig objects
Returns
Vector of ChannelPtrs (one per config)

Example:

auto channels = FastLED.add({
fl::ChannelConfig(PIN1, timing, leds1, RGB),
fl::ChannelConfig(PIN2, timing, leds2, RGB)
});
CRGB leds2[lengths[RedStrip]]
CRGB leds1[lengths[GreenStrip]]
CFastLED FastLED
Global LED strip management instance.
static fl::vector< fl::ChannelPtr > & channels()
stored ChannelPtrs to keep them alive
constexpr EOrder RGB
Definition eorder.h:17
constexpr ChipsetTimingConfig makeTimingConfig() FL_NOEXCEPT
Convert compile-time CHIPSET type to runtime timing config.
Configuration for a single LED channel.
Definition config.h:163

Definition at line 659 of file FastLED.cpp.hpp.

659 {
660 fl::vector<fl::ChannelPtr> channels;
661 channels.reserve(configs.size());
662
663 for (const auto& config : configs) {
664 channels.push_back(add(config));
665 }
666
667 return channels;
668}
static void add(fl::ChannelPtr channel)
Add a Channel-based LED controller (from ChannelPtr)

References add(), and channels().

+ Here is the call graph for this function: