FastLED  3.1
CLEDController Class Referenceabstract

Base definition for an LED controller. More...

#include <controller.h>

+ Inheritance diagram for CLEDController:
+ Collaboration diagram for CLEDController:

Public Member Functions

 CLEDController ()
 create an led controller object, add it to the chain of controllers
 
virtual void init ()=0
 initialize the LED controller
 
virtual void clearLeds (int nLeds)
 clear out/zero out the given number of leds.
 
void show (const struct CRGB *data, int nLeds, uint8_t brightness)
 show function w/integer brightness, will scale for color correction and temperature
 
void showColor (const struct CRGB &data, int nLeds, uint8_t brightness)
 show function w/integer brightness, will scale for color correction and temperature
 
void showLeds (uint8_t brightness=255)
 show function using the "attached to this controller" led data
 
void showColor (const struct CRGB &data, uint8_t brightness=255)
 show the given color on the led strip
 
CLEDControllernext ()
 get the next controller in the chain after this one. will return NULL at the end of the chain
 
CLEDControllersetLeds (CRGB *data, int nLeds)
 set the default array of leds to be used by this controller
 
void clearLedData ()
 zero out the led data managed by this controller
 
virtual int size ()
 How many leds does this controller manage?
 
CRGBleds ()
 Pointer to the CRGB array for this controller.
 
CRGBoperator[] (int x)
 Reference to the n'th item in the controller.
 
CLEDControllersetDither (uint8_t ditherMode=BINARY_DITHER)
 set the dithering mode for this controller to use
 
uint8_t getDither ()
 get the dithering option currently set for this controller
 
CLEDControllersetCorrection (CRGB correction)
 the the color corrction to use for this controller, expressed as an rgb object
 
CLEDControllersetCorrection (LEDColorCorrection correction)
 set the color correction to use for this controller
 
CRGB getCorrection ()
 get the correction value used by this controller
 
CLEDControllersetTemperature (CRGB temperature)
 set the color temperature, aka white point, for this controller
 
CLEDControllersetTemperature (ColorTemperature temperature)
 set the color temperature, aka white point, for this controller
 
CRGB getTemperature ()
 get the color temperature, aka whipe point, for this controller
 
CRGB getAdjustment (uint8_t scale)
 Get the combined brightness/color adjustment for this controller.
 
virtual uint16_t getMaxRefreshRate () const
 

Static Public Member Functions

static CLEDControllerhead ()
 get the first led controller in the chain of controllers
 
static CRGB computeAdjustment (uint8_t scale, const CRGB &colorCorrection, const CRGB &colorTemperature)
 

Protected Member Functions

virtual void showColor (const struct CRGB &data, int nLeds, CRGB scale)=0
 set all the leds on the controller to a given color More...
 
virtual void show (const struct CRGB *data, int nLeds, CRGB scale)=0
 write the passed in rgb data out to the leds managed by this controller More...
 

Protected Attributes

CRGBm_Data
 
CLEDControllerm_pNext
 
CRGB m_ColorCorrection
 
CRGB m_ColorTemperature
 
EDitherMode m_DitherMode
 
int m_nLeds
 

Static Protected Attributes

static CLEDControllerm_pHead = NULL
 
static CLEDControllerm_pTail = NULL
 

Friends

class CFastLED
 

Detailed Description

Base definition for an LED controller.

Pretty much the methods that every LED controller object will make available. Note that the showARGB method is not impelemented for all controllers yet. Note also the methods for eventual checking of background writing of data (I'm looking at you, teensy 3.0 DMA controller!). If you want to pass LED controllers around to methods, make them references to this type, keeps your code saner. However, most people won't be seeing/using these objects directly at all

Definition at line 38 of file controller.h.

Member Function Documentation

virtual void CLEDController::show ( const struct CRGB data,
int  nLeds,
CRGB  scale 
)
protectedpure virtual

write the passed in rgb data out to the leds managed by this controller

Parameters
datathe rgb data to write out to the strip
nLedsthe number of leds being written out
scalethe rgb scaling to apply to each led before writing it out

Implemented in CPixelLEDController< RGB_ORDER, LANES, MASK >, and CPixelLEDController< RGB_ORDER >.

virtual void CLEDController::showColor ( const struct CRGB data,
int  nLeds,
CRGB  scale 
)
protectedpure virtual

set all the leds on the controller to a given color

Parameters
datathe crgb color to set the leds to
nLedsthe numner of leds to set to this color
scalethe rgb scaling value for outputting color

Implemented in CPixelLEDController< RGB_ORDER, LANES, MASK >, and CPixelLEDController< RGB_ORDER >.


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