FastLED 3.6.0
|
Base definition for an LED controller.
Pretty much the methods that every LED controller object will make available. 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 61 of file controller.h.
#include <controller.h>
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) |
Write the passed in RGB data out to the LEDs managed by this controller. | |
void | showColor (const struct CRGB &data, int nLeds, uint8_t brightness) |
Set all the LEDs to a given color. | |
void | showLeds (uint8_t brightness=255) |
Write the data to the LEDs managed by this controller. | |
void | showColor (const struct CRGB &data, uint8_t brightness=255) |
Set all the LEDs to a given color. | |
CLEDController * | next () |
Get the next controller in the linked list after this one. | |
CLEDController & | setLeds (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? | |
virtual int | lanes () |
How many Lanes does this controller manage? | |
CRGB * | leds () |
Pointer to the CRGB array for this controller. | |
CRGB & | operator[] (int x) |
Reference to the n'th LED managed by the controller. | |
CLEDController & | setDither (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. | |
CLEDController & | setCorrection (CRGB correction) |
The color corrction to use for this controller, expressed as a CRGB object. | |
CLEDController & | setCorrection (LEDColorCorrection correction) |
The color corrction to use for this controller, expressed as a CRGB object. | |
CRGB | getCorrection () |
Get the correction value used by this controller. | |
CLEDController & | setTemperature (CRGB temperature) |
Set the color temperature, aka white point, for this controller. | |
CLEDController & | setTemperature (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 |
Gets the maximum possible refresh rate of the strip. | |
Static Public Member Functions | |
static CLEDController * | head () |
Get the first LED controller in the linked list of controllers. | |
static CRGB | computeAdjustment (uint8_t scale, const CRGB &colorCorrection, const CRGB &colorTemperature) |
Calculates the combined color adjustment to the LEDs at a given scale, color correction, and color temperature. | |
Protected Member Functions | |
virtual void | showColor (const struct CRGB &data, int nLeds, CRGB scale)=0 |
Set all the LEDs to a given color. | |
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. | |
Protected Attributes | |
CRGB * | m_Data |
pointer to the LED data used by this controller | |
CLEDController * | m_pNext |
pointer to the next LED controller in the linked list | |
CRGB | m_ColorCorrection |
CRGB object representing the color correction to apply to the strip on show() | |
CRGB | m_ColorTemperature |
CRGB object representing the color temperature to apply to the strip on show() | |
EDitherMode | m_DitherMode |
the current dither mode of the controller | |
int | m_nLeds |
the number of LEDs in the LED data array | |
Static Protected Attributes | |
static CLEDController * | m_pHead = NULL |
pointer to the first LED controller in the linked list | |
static CLEDController * | m_pTail = NULL |
pointer to the last LED controller in the linked list | |
Friends | |
class | CFastLED |
|
inline |
Create an led controller object, add it to the chain of controllers.
Definition at line 87 of file controller.h.
|
inline |
Zero out the LED data managed by this controller.
Definition at line 157 of file controller.h.
|
inlinevirtual |
Clear out/zero out the given number of LEDs.
nLeds | the number of LEDs to clear |
Definition at line 99 of file controller.h.
|
inlinestatic |
Calculates the combined color adjustment to the LEDs at a given scale, color correction, and color temperature.
scale | the scale value for the RGB data (i.e. brightness) |
colorCorrection | color correction to apply |
colorTemperature | color temperature to apply |
Definition at line 225 of file controller.h.
|
inline |
Get the combined brightness/color adjustment for this controller.
scale | the brightness scale to get the correction for |
Definition at line 216 of file controller.h.
|
inline |
Get the correction value used by this controller.
Definition at line 199 of file controller.h.
|
inline |
Get the dithering option currently set for this controller.
Definition at line 187 of file controller.h.
|
inlinevirtual |
Gets the maximum possible refresh rate of the strip.
Definition at line 249 of file controller.h.
|
inline |
Get the color temperature, aka whipe point, for this controller.
Definition at line 211 of file controller.h.
|
inlinestatic |
Get the first LED controller in the linked list of controllers.
Definition at line 141 of file controller.h.
|
pure virtual |
Initialize the LED controller.
Implemented in LPD8806Controller< DATA_PIN, CLOCK_PIN, RGB_ORDER, SPI_SPEED >, WS2801Controller< DATA_PIN, CLOCK_PIN, RGB_ORDER, SPI_SPEED >, WS2801Controller< DATA_PIN, CLOCK_PIN, RGB, DATA_RATE_MHZ(25) >, LPD6803Controller< DATA_PIN, CLOCK_PIN, RGB_ORDER, SPI_SPEED >, APA102Controller< DATA_PIN, CLOCK_PIN, RGB_ORDER, SPI_SPEED >, SK9822Controller< DATA_PIN, CLOCK_PIN, RGB_ORDER, SPI_SPEED >, P9813Controller< DATA_PIN, CLOCK_PIN, RGB_ORDER, SPI_SPEED >, SM16716Controller< DATA_PIN, CLOCK_PIN, RGB_ORDER, SPI_SPEED >, DMXSimpleController< DATA_PIN, RGB_ORDER >, DMXSimpleController< DATA_PIN, RGB_ORDER >, DMXSerialController< RGB_ORDER >, and DMXSerialController< RGB_ORDER >.
|
inlinevirtual |
How many Lanes does this controller manage?
Reimplemented in CPixelLEDController< RGB_ORDER, LANES, MASK >, and CPixelLEDController< RGB >.
Definition at line 169 of file controller.h.
|
inline |
Pointer to the CRGB array for this controller.
Definition at line 173 of file controller.h.
|
inline |
Get the next controller in the linked list after this one.
Will return NULL at the end of the linked list.
Definition at line 145 of file controller.h.
|
inline |
Reference to the n'th LED managed by the controller.
x | the LED number to retrieve |
Definition at line 178 of file controller.h.
|
inline |
The color corrction to use for this controller, expressed as a CRGB object.
correction | the color correction to set |
Definition at line 192 of file controller.h.
|
inline |
The color corrction to use for this controller, expressed as a CRGB object.
correction | the color correction to set |
Definition at line 195 of file controller.h.
|
inline |
Set the dithering mode for this controller to use.
ditherMode | the dithering mode to set |
Definition at line 183 of file controller.h.
|
inline |
Set the default array of LEDs to be used by this controller.
data | pointer to the LED data |
nLeds | the number of LEDs in the LED data |
Definition at line 150 of file controller.h.
|
inline |
Set the color temperature, aka white point, for this controller.
temperature | the color temperature to set |
Definition at line 207 of file controller.h.
|
inline |
Set the color temperature, aka white point, for this controller.
temperature | the color temperature to set |
Definition at line 204 of file controller.h.
|
protectedpure virtual |
Write the passed in RGB data out to the LEDs managed by this controller.
data | the rgb data to write out to the strip |
nLeds | the number of LEDs being written out |
scale | the rgb scaling to apply to each led before writing it out |
Implemented in CPixelLEDController< RGB_ORDER, LANES, MASK >, and CPixelLEDController< RGB >.
|
inline |
Write the passed in RGB data out to the LEDs managed by this controller.
Will scale for color correction and temperature. Can accept LED data not attached to this controller.
data | the LED data to write to the strip |
nLeds | the number of LEDs in the data array |
brightness | the brightness of the LEDs |
Definition at line 108 of file controller.h.
|
protectedpure virtual |
Set all the LEDs to a given color.
data | the CRGB color to set the LEDs to |
nLeds | the number of LEDs to set to this color |
scale | the rgb scaling value for outputting color |
Implemented in CPixelLEDController< RGB_ORDER, LANES, MASK >, and CPixelLEDController< RGB >.
|
inline |
Set all the LEDs to a given color.
Will scale for color correction and temperature. Can accept LED data not attached to this controller.
data | the CRGB color to set the LEDs to |
nLeds | the number of LEDs in the data array |
brightness | the brightness of the LEDs |
Definition at line 119 of file controller.h.
|
inline |
Set all the LEDs to a given color.
data | the CRGB color to set the LEDs to |
brightness | the brightness of the LEDs |
Definition at line 135 of file controller.h.
|
inline |
Write the data to the LEDs managed by this controller.
brightness | the brightness of the LEDs |
Definition at line 126 of file controller.h.
|
inlinevirtual |
How many LEDs does this controller manage?
Definition at line 165 of file controller.h.
|
friend |
Definition at line 63 of file controller.h.
|
protected |
CRGB object representing the color correction to apply to the strip on show()
Definition at line 66 of file controller.h.
|
protected |
CRGB object representing the color temperature to apply to the strip on show()
Definition at line 67 of file controller.h.
|
protected |
pointer to the LED data used by this controller
Definition at line 64 of file controller.h.
|
protected |
the current dither mode of the controller
Definition at line 68 of file controller.h.
|
protected |
the number of LEDs in the LED data array
Definition at line 69 of file controller.h.
|
staticprotected |
pointer to the first LED controller in the linked list
Definition at line 70 of file controller.h.
|
protected |
pointer to the next LED controller in the linked list
Definition at line 65 of file controller.h.
|
staticprotected |
pointer to the last LED controller in the linked list
Definition at line 71 of file controller.h.