upm  1.3.0
Sensor/Actuator repository for libmraa (v1.7.0)
 All Data Structures Namespaces Files Functions Variables Typedefs 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(0, 7, 10);
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 (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

Parameters
busSPI bus to use
csnChip select pin
pixelCountNumber of pixels in the strip
~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: