Class daisy::DotStar¶
Device support for Adafruit DotStar LEDs (Opsco SK9822)More...
#include <dotstar.h>
Classes¶
Type | Name |
---|---|
struct | Config |
Public Types¶
Type | Name |
---|---|
enum | Result |
Public Functions¶
Type | Name |
---|---|
void | Clear () Clears all current color data. Does not reset global brightnesses. Does not write pixel buffer data to LEDs. |
DotStar () |
|
void | Fill (const Color & color) Fills all pixels with color. |
void | Fill (uint32_t color) Fills all pixels with color. |
void | Fill (uint8_t r, uint8_t g, uint8_t b) Fill all pixels with color. |
uint16_t | GetPixelColor (uint16_t idx) |
Result | Init (Config & config) |
void | SetAllGlobalBrightness (uint16_t b) Set global brightness for all pixels. |
void | SetPixelColor (uint16_t idx, const Color & color) Sets color of a single pixel. |
void | SetPixelColor (uint16_t idx, uint32_t color) Sets color of a single pixel. |
Result | SetPixelColor (uint16_t idx, uint8_t r, uint8_t g, uint8_t b) Sets color of a single pixel. |
Result | SetPixelGlobalBrightness (uint16_t idx, uint16_t b) Set global brightness for a single pixel. |
Result | Show () Writes current pixel buffer data to LEDs. |
~DotStar () |
Detailed Description¶
Author:
Nick Donaldson
Date:
March 2023
Public Types Documentation¶
enum Result¶
Public Functions Documentation¶
function Clear¶
Clears all current color data. Does not reset global brightnesses. Does not write pixel buffer data to LEDs.
function DotStar¶
function Fill [⅓]¶
Fills all pixels with color.
Parameters:
color
Color with which to fill all pixels
function Fill [⅔]¶
Fills all pixels with color.
Parameters:
color
32-bit integer representing 24-bit RGB color. MSB ignored.
function Fill [3/3]¶
Fill all pixels with color.
Parameters:
r
8-bit red value to apply to pixelsg
8-bit green value to apply to pixelsb
8-bit blue value to apply to pixels
function GetPixelColor¶
function Init¶
function SetAllGlobalBrightness¶
Set global brightness for all pixels.
"Global brightness" for the SK9822 device sets the equivalent constant current for the LEDs, not a pre-multiplied PWM brightness scaling for the pixel's RGB value. See SK9822 datasheet for details.
Warning:
Recommend not going above 10, especially for SK9822-EC20 which may overheat if you do.
Parameters:
b
5-bit global brightness setting (0 - 31)
function SetPixelColor [⅓]¶
Sets color of a single pixel.
Parameters:
idx
Index of the pixelcolor
Color object to apply to the pixel
function SetPixelColor [⅔]¶
Sets color of a single pixel.
Parameters:
color
32-bit integer representing 24-bit RGB color. MSB ignored.
function SetPixelColor [3/3]¶
Sets color of a single pixel.
Parameters:
idx
Index of the pixelr
8-bit red value to apply to pixelg
8-bit green value to apply to pixelb
8-bit blue value to apply to pixel
function SetPixelGlobalBrightness¶
Set global brightness for a single pixel.
"Global brightness" for the SK9822 device sets the equivalent constant current for the LEDs. See datasheet for details.
Warning:
Recommend not going above 10, especially for SK9822-EC20 which may overheat if you do.
Parameters:
idx
Index of the pixel for which to set global brightnessb
5-bit global brightness setting (0 - 31)
function Show¶
Writes current pixel buffer data to LEDs.
function ~DotStar¶
The documentation for this class was generated from the following file external-docs/libDaisy/src/dev/dotstar.h