upm  0.5.1
Sensor/Actuator repository for libmraa (v0.9.1)
 All Data Structures Files Functions Variables Enumerations Enumerator Macros Groups Pages
Public Member Functions
LPD8806 Class Reference

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

Detailed Description

FastPixel* LPD8806 is an RGB LED strip controller.

lpd8806.jpg
sensor = new upm::LPD8806(10, 7);
usleep (1000000);
sensor->show ();
while (!doWork) {
// Back-and-forth lights
scanner(127, 0, 0, 30); // red, slow
scanner(0, 0, 127, 15); // blue, fast
usleep (1000000);
}

Public Member Functions

 LPD8806 (uint16_t pixelCount, uint8_t csn)
 
 ~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 ( uint16_t  pixelCount,
uint8_t  csn 
)

Instantiates an LPD8806 object

Parameters
pixelCountNumber of pixels in the strip
csnChip select pin
~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 
)
Parameters
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 ( )
inline

Returns the name of the component


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