upm  1.5.0
Sensor/Actuator repository for libmraa (v1.8.0)
Public Member Functions

API for the LPD8806 RGB LED Strip Controller. More...

Detailed Description

FastPixel* LPD8806 is an RGB LED strip controller.

upm::LPD8806 sensor(0, 7, 10);
while (!doWork) {
// Back-and-forth lights
scanner(sensor, 127, 0, 0, 30); // red, slow
scanner(sensor, 0, 0, 127, 15); // blue, fast

Public Member Functions

 LPD8806 (int bus, int csn, uint16_t pixelCount)
 ~LPD8806 ()
void setPixelColor (uint16_t pixelOffset, uint8_t r, uint8_t g, uint8_t b)
void show (void)
uint16_t getStripLength (void)
std::string name ()

Constructor & Destructor Documentation

LPD8806 ( int  bus,
int  csn,
uint16_t  pixelCount 

Instantiates an LPD8806 object

busSPI bus to use
csnChip select pin
pixelCountNumber of pixels in the strip

Here is the caller graph for this function:

~LPD8806 ( )

LPD8806 object destructor; basically, it frees the allocated pixel buffer.

Member Function Documentation

void setPixelColor ( uint16_t  pixelOffset,
uint8_t  r,
uint8_t  g,
uint8_t  b 
pixelOffsetPixel offset in the strip of the pixel
rRed LED
gGreen LED
bBlue LED
void show ( void  )

Writes the data stored in the array of pixels to the chip

uint16_t getStripLength ( void  )

Returns the length of the LED strip

std::string name ( )

Returns the name of the component

Here is the call graph for this function:

The documentation for this class was generated from the following files: