Creates and registers a Channel-based LED controller with runtime-configurable timing. Returns a shared_ptr handle for later inspection, reconfiguration, or removal. FastLED retains its own reference until remove(channel) is called.
auto channel =
FastLED.add(config);
CFastLED FastLED
Global LED strip management instance.
CRGB * leds() FL_NO_EXCEPT
Get a pointer to led data for the first controller.
void fill_solid(CRGB *targetArray, int numToFill, const CRGB &color) FL_NO_EXCEPT
Fill a range of LEDs with a solid color.
constexpr ChipsetTimingConfig makeTimingConfig() FL_NO_EXCEPT
Convert compile-time CHIPSET type to runtime timing config.
@ Red
<div style='background:#FF0000;width:4em;height:4em;'></div>
Configuration for a single LED channel.
821 {
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836 #ifndef FASTLED_SUPPRESS_RUNTIME_DRIVER_WARNING
837 FL_WARN_ONCE(
"FastLED.add(cfg): runtime-selection mode — enrolling every "
838 "available driver via fl::enableAllDrivers(). For minimum "
839 "binary size, prefer FastLED.addLeds<CHIPSET, PIN, ORDER, "
840 "fl::Bus::X>(leds, n) which links only the named driver. "
841 "Suppress this warning with -DFASTLED_SUPPRESS_RUNTIME_DRIVER_WARNING.");
842 #endif
844
847 "No channel drivers available - channel API requires at least one registered driver");
850 return channel;
851}
#define FL_ASSERT(x, MSG)
static void add(fl::ChannelPtr channel) FL_NO_EXCEPT
Add a Channel-based LED controller (from ChannelPtr)
static ChannelPtr create(const ChannelConfig &config) FL_NO_EXCEPT
Create a new channel with optional mBus driver pinning.
fl::size getDriverCount() const FL_NO_EXCEPT
Get count of registered drivers (including unnamed ones)
#define FL_WARN_ONCE(...)
void enableAllDrivers() FL_NO_EXCEPT
Register every channel driver available on this platform with ChannelManager, restoring 3....
ChannelManager & channelManager() FL_NO_EXCEPT
Get the global ChannelManager singleton instance.