FastLED 3.9.15
Loading...
Searching...
No Matches
fl::FastLEDAdapter Class Reference

Detailed Description

Real FastLED implementation adapter.

This class adapts the global FastLED singleton to the IFastLED interface. It provides a thin wrapper that delegates all operations to the global FastLED object while optionally managing segment control for specific LED controller indices.

This adapter allows WLED and other integrations to work with FastLED through a standard interface while maintaining full compatibility with the existing FastLED API.

Example usage:

CRGB leds[100];
FastLED.addLeds<WS2812, 5>(leds, 100);
controller->setBrightness(128);
controller->show();
fl::CRGB leds[NUM_LEDS]
FL_DISABLE_WARNING_PUSH FL_DISABLE_WARNING_GLOBAL_CONSTRUCTORS CFastLED FastLED
Global LED strip management instance.
CLEDController * controller
shared_ptr< T > make_shared(Args &&... args) FL_NOEXCEPT
Definition shared_ptr.h:414
Representation of an 8-bit RGB pixel (Red, Green, Blue)
Definition crgb.h:38
See also
IFastLED for the interface definition
createFastLEDController() for helper functions to create adapters

Definition at line 33 of file adapter.h.

#include <adapter.h>

+ Inheritance diagram for fl::FastLEDAdapter:
+ Collaboration diagram for fl::FastLEDAdapter:

Public Member Functions

 FastLEDAdapter (u8 controllerIndex=0)
 Construct adapter wrapping the global FastLED object.
 
 ~FastLEDAdapter () FL_NOEXCEPT override=default
 Destructor.
 
void clear (bool writeToStrip=false) override
 Clear all LEDs (set to black)
 
void clearSegment () override
 Clear the segment range (operate on full LED array)
 
void delay (unsigned long ms) override
 Delay for a specified number of milliseconds.
 
u8 getBrightness () const override
 Get the current global brightness.
 
fl::span< CRGBgetLEDs () override
 Get the LED array as a span.
 
u16 getMaxRefreshRate () const override
 Get the maximum refresh rate.
 
size_t getNumLEDs () const override
 Get the number of LEDs.
 
void setBrightness (u8 brightness) override
 Set the global brightness.
 
void setCorrection (CRGB correction) override
 Set color correction.
 
void setMaxRefreshRate (u16 fps) override
 Set the maximum refresh rate.
 
void setSegment (size_t start, size_t end) override
 Set a segment range for subsequent operations.
 
void setTemperature (CRGB temperature) override
 Set color temperature.
 
void show () override
 Send the LED data to the strip Uses the current brightness setting.
 
void show (u8 brightness) override
 Send the LED data to the strip with a specific brightness.
 
- Public Member Functions inherited from fl::IFastLED
virtual ~IFastLED () FL_NOEXCEPT=default
 

Private Attributes

u8 mControllerIndex
 
bool mHasSegment
 
size_t mSegmentEnd
 
size_t mSegmentStart
 

The documentation for this class was generated from the following files: