upm  1.7.1
Sensor/Actuator repository for libmraa (v2.0.0)
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
Public Member Functions

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

Detailed Description

FastPixel* LPD8806 is an RGB LED strip controller.

lpd8806.jpg
upm::LPD8806 sensor(0, 7, 10);
upm_delay_us(1000000);
sensor.show();
while (!doWork) {
// Back-and-forth lights
scanner(sensor, 127, 0, 0, 30); // red, slow
scanner(sensor, 0, 0, 127, 15); // blue, fast
upm_delay_us(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

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 
)
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

Here is the call graph for this function:


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