|
uint32_t | getBrightness () |
| Get the brightness as a percentage. More...
|
|
uint16_t | getPixelCount () |
| Return the number of pixels in the chain. More...
|
|
virtual void | init ()=0 |
|
virtual void | show ()=0 |
|
void | setBrightness (uint32_t percent) |
| Set the brightness as a percentage. More...
|
|
void | setColorOrder (char *order) |
| Set the color order of data sent to the LEDs. More...
|
|
void | setPixel (uint16_t index, uint8_t red, uint8_t green, uint8_t blue) |
| Set the given pixel to the specified color. More...
|
|
void | setPixel (uint16_t index, pixel_t pixel) |
| Set the given pixel to the specified color. More...
|
|
void | setPixel (uint16_t index, uint32_t pixel) |
| Set the given pixel to the specified color. More...
|
|
void | setPixelCount (uint16_t pixelCount) |
|
void | setHSBPixel (uint16_t index, uint16_t hue, uint8_t saturation, uint8_t brightness) |
| Set the given pixel to the specified HSB color. More...
|
|
void | clear () |
| Clear all the pixel colors. More...
|
|
|
uint32_t | m_brightness |
|
char * | m_colorOrder |
|
uint16_t | m_pixelCount |
|
pixel_t * | m_pixels |
|
Clear all the pixel colors.
This sets all the pixels to off which is no brightness for all of the color channels. The LEDs are not actually updated until a call to show() is subsequently made.
uint32_t SmartLED::getBrightness |
( |
| ) |
|
Get the brightness as a percentage.
- Returns
- The brightness as a percentage.
uint16_t SmartLED::getPixelCount |
( |
| ) |
|
Return the number of pixels in the chain.
- Returns
- The number of pixels in the chain as previously set by setPixelCount().
void SmartLED::setBrightness |
( |
uint32_t |
percent | ) |
|
Set the brightness as a percentage.
- Parameters
-
[in] | percent | The brightness. |
void SmartLED::setColorOrder |
( |
char * |
colorOrder | ) |
|
Set the color order of data sent to the LEDs.
Data is sent to the WS2812s in a serial fashion. There are 8 bits of data for each of the three channel colors (red, green and blue). The WS2812 LEDs typically expect the data to arrive in the order of "green" then "red" then "blue". However, this has been found to vary between some models and manufacturers. What this means is that some want "red", "green", "blue" and still others have their own orders. This function can be called to override the default ordering of "GRB". We can specify an alternate order by supply an alternate three character string made up of 'R', 'G' and 'B' for example "RGB".
void SmartLED::setHSBPixel |
( |
uint16_t |
index, |
|
|
uint16_t |
hue, |
|
|
uint8_t |
saturation, |
|
|
uint8_t |
brightness |
|
) |
| |
Set the given pixel to the specified HSB color.
The LEDs are not actually updated until a call to show().
- Parameters
-
[in] | index | The pixel that is to have its color set. |
[in] | hue | The amount of hue in the pixel (0-360). |
[in] | saturation | The amount of saturation in the pixel (0-255). |
[in] | brightness | The amount of brightness in the pixel (0-255). |
void SmartLED::setPixel |
( |
uint16_t |
index, |
|
|
uint8_t |
red, |
|
|
uint8_t |
green, |
|
|
uint8_t |
blue |
|
) |
| |
Set the given pixel to the specified color.
The LEDs are not actually updated until a call to show() is subsequently made.
- Parameters
-
[in] | index | The pixel that is to have its color set. |
[in] | red | The amount of red in the pixel. |
[in] | green | The amount of green in the pixel. |
[in] | blue | The amount of blue in the pixel. |
void SmartLED::setPixel |
( |
uint16_t |
index, |
|
|
pixel_t |
pixel |
|
) |
| |
Set the given pixel to the specified color.
The LEDs are not actually updated until a call to show().
- Parameters
-
[in] | index | The pixel that is to have its color set. |
[in] | pixel | The color value of the pixel. |
void SmartLED::setPixel |
( |
uint16_t |
index, |
|
|
uint32_t |
pixel |
|
) |
| |
Set the given pixel to the specified color.
The LEDs are not actually updated until a call to show().
- Parameters
-
[in] | index | The pixel that is to have its color set. |
[in] | pixel | The color value of the pixel. |
The documentation for this class was generated from the following files: