upm  0.1.8
Sensor/Actuator repository for libmraa (v0.4.5)
 All Data Structures Files Functions Variables Macros Pages
Public Member Functions
LPD8806 Class Reference

C++ API for LPD8806. More...

Detailed Description

The FastPixel lpd8806 is an RGB led strip controller.

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);
}
lpd8806.jpeg

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 
)

Instanciates a LPD8806 object

Parameters
pixelCountnumber of pixels in the strip
csnchip slect pin
~LPD8806 ( )

LPD8806 object destructor, basicaly it close SPI and the GPIO.

Member Function Documentation

void setPixelColor ( uint16_t  pixelOffset,
uint8_t  r,
uint8_t  g,
uint8_t  b 
)
Parameters
pixelOffsetpixel offset in the strip of pixel
rred led
ggreen led
bblue led
void show ( void  )

Write the data stored in array of pixels to the chip

uint16_t getStripLength ( void  )

Return length of the led strip

std::string name ( )
inline

Return name of the component


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