LPD6803 RGB Pixels
Public Member Functions | List of all members
LPD6803 Class Reference

Class that stores state and functions for interacting with LPD6803 RGB Pixels. More...

#include <LPD6803.h>

Public Member Functions

 LPD6803 (uint16_t n, uint8_t dpin, uint8_t cpin)
 LPD6803 constructor. More...
 
void begin ()
 Starts I2C connection.
 
void show ()
 Shows pixels on LEDs.
 
void doSwapBuffersAsap (uint16_t idx)
 Update the pixels when next possible. More...
 
void setPixelColor (uint16_t n, uint8_t r, uint8_t g, uint8_t b)
 Set a pixel's color using separate red, green and blue components. More...
 
void setPixelColor (uint16_t n, uint16_t c)
 Set a pixel's color using a 32-bit 'packed' RGB or RGBW value. More...
 
void setCPUmax (uint8_t m)
 Sets max cpu speed. More...
 
uint16_t numPixels (void)
 Number of pixels connected. More...
 

Detailed Description

Class that stores state and functions for interacting with LPD6803 RGB Pixels.

Constructor & Destructor Documentation

◆ LPD6803()

LPD6803::LPD6803 ( uint16_t  n,
uint8_t  dpin,
uint8_t  cpin 
)

LPD6803 constructor.

Parameters
nNumber of pixels
dpinData pin
cpinClock pin

Member Function Documentation

◆ doSwapBuffersAsap()

void LPD6803::doSwapBuffersAsap ( uint16_t  idx)

Update the pixels when next possible.

Parameters
idxWhich LED we are updating

◆ setPixelColor() [1/2]

void LPD6803::setPixelColor ( uint16_t  n,
uint8_t  r,
uint8_t  g,
uint8_t  b 
)

Set a pixel's color using separate red, green and blue components.

Parameters
nPixel index, starting from 0
rRed brightness, 0 = minimum (off), 255 = maximum
gGreen brightness, 0 = minimum (off), 255 = maximum
bBlue brightness, 0 = minimum (off), 255 = maximum

◆ setPixelColor() [2/2]

void LPD6803::setPixelColor ( uint16_t  n,
uint16_t  c 
)

Set a pixel's color using a 32-bit 'packed' RGB or RGBW value.

Parameters
nPixel index, starting from 0.
c32-bit color value. Most significant byte is white (for RGBW pixels) or ignored (for RGB pixels), next is red, then green, and least significant byte is blue

◆ setCPUmax()

void LPD6803::setCPUmax ( uint8_t  m)

Sets max cpu speed.

Parameters
mmax CPU clock speed, in MHz

◆ numPixels()

uint16_t LPD6803::numPixels ( void  )

Number of pixels connected.

Returns
Returns a 16-bit signed int equal to how many pixels are connected

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