Little-Wire
 All Classes Functions Groups Pages
WS2812

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)
 

Detailed Description

WS2812 programmable RGB-LED support.

Function Documentation

void ws2812_flush ( littleWire *  lwHandle,
unsigned char  pin 
)

This function flushes the contents of the littlewire internal RGB buffer to the LED string.

Parameters
lwHandlelittleWire device pointer
rvalue of the red channel
gvalue of the green channel
bvalue of the blue channel
Returns
(none)

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

Parameters
lwHandlelittleWire device pointer
rvalue of the red channel
gvalue of the green channel
bvalue of the blue channel
Returns
(none)

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.

Parameters
lwHandlelittleWire device pointer
rvalue of the red channel
gvalue of the green channel
bvalue of the blue channel
pinPin name (PIN1 , PIN2 , PIN3 or PIN4 )
Returns
(none)

Definition at line 369 of file littleWire.c.