PropWare
3.0.0.229
C++ objects and CMake build system for Parallax Propeller
|
An easy-to-use, cheap, small, and bright multicolor LED capable of being strung together in a lengthy line. More...
#include <PropWare/hmi/output/ws2812.h>
Public Types | |
enum | Type { RGB, Type::GRB } |
Support both types of multicolor LEDs, RGB and GRB. More... | |
enum | Color { BLACK = 0x000000, RED = 0xFF0000, GREEN = 0x00FF00, BLUE = 0x0000FF, WHITE = 0xFFFFFF, CYAN = 0x00FFFF, MAGENTA = 0xFF00FF, YELLOW = 0xFFFF00, CHARTREUSE = 0x7FFF00, ORANGE = 0xFF6000, AQUAMARINE = 0x7FFFD4, PINK = 0xFF5F5F, TURQUOISE = 0x3FE0C0, REALWHITE = 0xC8FFFF, INDIGO = 0x3F007F, VIOLET = 0xBF7FBF, MAROON = 0x320010, BROWN = 0x0E0600, CRIMSON = 0xDC283C } |
Provide some common color codes. | |
Public Member Functions | |
WS2812 (const Pin::Mask pinMask, const Type type) | |
Construct an instance connected to the given output line. More... | |
void | send (const unsigned int color) const |
Send a given color to the first LED in line. More... | |
void | send_array (const unsigned int *buffer, const size_t length) const |
Send a series of colors to a series of LEDs. More... | |
uint32_t | wheel (unsigned int position) const |
uint32_t | wheel_dim (unsigned int position, unsigned int brightness) const |
Type | get_type () const |
Obtain the currently set RGB/GRB type. More... | |
Static Public Member Functions | |
static unsigned int | to_color (const unsigned int red, const unsigned int green, const unsigned int blue) |
Convert RGB values to a color code. More... | |
static unsigned int | scale (const unsigned int x, const unsigned int l) |
static unsigned int | colorx (const unsigned int red, const unsigned int green, const unsigned int blue, const unsigned int l) |
An easy-to-use, cheap, small, and bright multicolor LED capable of being strung together in a lengthy line.
|
strong |
Type PropWare::WS2812::get_type | ( | ) | const |
void PropWare::WS2812::send | ( | const unsigned int | color | ) | const |
void PropWare::WS2812::send_array | ( | const unsigned int * | buffer, |
const size_t | length | ||
) | const |
|
static |