Robert Bui / Multi_WS2811

Fork of Multi_WS2811 by Richard Thompson

Embed: (wiki syntax)

« Back to documentation index

LedStrip Class Reference

Generic LED Strip Pure virtual parent class for all types of LED strip. More...

#include <LedStrip.h>

Inherited by WS2811.

Public Member Functions

 LedStrip (uint16_t pixelCount)
 Create an LED strip.
virtual void begin (void)=0
 Initialise the LED strip.
virtual void show (void)=0
 Apply the new LED strip values.
virtual void blank (void)=0
 Blank the LED strip.
uint16_t numPixels ()
 Number of RGB pixels.
uint16_t numPixelBytes ()
 Number of bytes used for pixel colour data.
uint32_t total_luminance ()
 Total brightness of all diodes
Use to check power budget.
void setPixelB (uint16_t pixNum, uint8_t blue)
 Set Blue level of pixel.
void setPixelG (uint16_t pixNum, uint8_t green)
 Set Green level of pixel.
void setPixelR (uint16_t pixNum, uint8_t red)
 Set Red level of pixel.
void setPixelColor (uint16_t pixNum, uint32_t color)
 Set color of pixel.
void setPixelColor (uint16_t pixNum, uint8_t red, uint8_t green, uint8_t blue)
 Set color of pixel.
void setPackedPixels (uint8_t *buffer, uint32_t count)
 Set color of all pixels.

Static Public Member Functions

static uint32_t Color (uint8_t red, uint8_t green, uint8_t blue)
 Pack RGB Color data.

Detailed Description

Generic LED Strip Pure virtual parent class for all types of LED strip.

Definition at line 19 of file LedStrip.h.


Constructor & Destructor Documentation

LedStrip ( uint16_t  pixelCount )

Create an LED strip.

Parameters:
pixelCountNumber of RGB LEDs on the strip

Definition at line 3 of file LedStrip.cpp.


Member Function Documentation

virtual void begin ( void   ) [pure virtual]

Initialise the LED strip.

Implemented in WS2811.

virtual void blank ( void   ) [pure virtual]

Blank the LED strip.

Implemented in WS2811.

uint32_t Color ( uint8_t  red,
uint8_t  green,
uint8_t  blue 
) [static]

Pack RGB Color data.

Parameters:
redAmount of Red
greenAmount of Green
blueAmount of Blue
Returns:
Packed RGB color data for one pixel

Definition at line 28 of file LedStrip.cpp.

uint16_t numPixelBytes (  )

Number of bytes used for pixel colour data.

Definition at line 48 of file LedStrip.h.

uint16_t numPixels (  )

Number of RGB pixels.

Definition at line 44 of file LedStrip.h.

void setPackedPixels ( uint8_t *  buffer,
uint32_t  count 
)

Set color of all pixels.

Parameters:
*bufferPacked pixel data
countNumber of pixels

Definition at line 64 of file LedStrip.cpp.

void setPixelB ( uint16_t  pixNum,
uint8_t  blue 
)

Set Blue level of pixel.

Parameters:
pixNumPixel Number
blueAmount of Blue

Definition at line 57 of file LedStrip.cpp.

void setPixelColor ( uint16_t  pixNum,
uint8_t  red,
uint8_t  green,
uint8_t  blue 
)

Set color of pixel.

Parameters:
pixNumPixel Number
redAmount of Red
greenAmount of Green
blueAmount of Blue

Definition at line 34 of file LedStrip.cpp.

void setPixelColor ( uint16_t  pixNum,
uint32_t  color 
)

Set color of pixel.

Parameters:
pixNumPixel Number
colorPacked RGB color data

Definition at line 70 of file LedStrip.cpp.

void setPixelG ( uint16_t  pixNum,
uint8_t  green 
)

Set Green level of pixel.

Parameters:
pixNumPixel Number
greenAmount of Green

Definition at line 50 of file LedStrip.cpp.

void setPixelR ( uint16_t  pixNum,
uint8_t  red 
)

Set Red level of pixel.

Parameters:
pixNumPixel Number
redAmount of Red

Definition at line 43 of file LedStrip.cpp.

virtual void show ( void   ) [pure virtual]

Apply the new LED strip values.

Implemented in WS2811.

uint32_t total_luminance (  )

Total brightness of all diodes
Use to check power budget.

Returns:
Sum total of all diodes (red + green + blue)

Definition at line 18 of file LedStrip.cpp.