Little-Wire
|
WS2812 programmable RGB-LED support. More...
Functions | |
void | ws2812_write (littleWire *lwHandle, unsigned char pin, unsigned char r, unsigned char g, unsigned char b) |
void | ws2812_flush (littleWire *lwHandle, unsigned char pin) |
void | ws2812_preload (littleWire *lwHandle, unsigned char r, unsigned char g, unsigned char b) |
WS2812 programmable RGB-LED support.
void ws2812_flush | ( | littleWire * | lwHandle, |
unsigned char | pin | ||
) |
This function flushes the contents of the littlewire internal RGB buffer to the LED string.
lwHandle | littleWire device pointer |
r | value of the red channel |
g | value of the green channel |
b | value of the blue channel |
Definition at line 374 of file littleWire.c.
void ws2812_preload | ( | littleWire * | lwHandle, |
unsigned char | r, | ||
unsigned char | g, | ||
unsigned char | b | ||
) |
Preloads a RGB value to the internal buffer. Up to 64 values can be preloaded. Further writes will be ignored
lwHandle | littleWire device pointer |
r | value of the red channel |
g | value of the green channel |
b | value of the blue channel |
Definition at line 379 of file littleWire.c.
void ws2812_write | ( | littleWire * | lwHandle, |
unsigned char | pin, | ||
unsigned char | r, | ||
unsigned char | g, | ||
unsigned char | b | ||
) |
Writes to a WS2812 RGB-LED. This function writes the passed rgb values to a WS2812 led string connected to the given pin. Use this if you want to control a single LED.
If RGB values were preloaded with the preload call, the values passed in this call are added to the buffer and the entire buffer is written to the LED string. This feature can be used to reduce the number of USB transmissions for a string.
lwHandle | littleWire device pointer |
r | value of the red channel |
g | value of the green channel |
b | value of the blue channel |
pin | Pin name (PIN1 , PIN2 , PIN3 or PIN4 ) |
Definition at line 369 of file littleWire.c.