Subversion Repositories Projects

Compare Revisions

Ignore whitespace Rev 1767 → Rev 1768

/Digital_RGB_LED_Stripes/tags/KopterLight2_08/lib/LPD8806_kopterlight.h
0,0 → 1,48
#if (ARDUINO >= 100)
#include <Arduino.h>
#else
#include <WProgram.h>
#include <pins_arduino.h>
#endif
 
class LPD8806 {
 
public:
 
LPD8806(uint16_t n, uint8_t dpin, uint8_t cpin, uint8_t rig); // Configurable pins
LPD8806(uint16_t n, uint8_t rig); // Use SPI hardware; specific pins only
LPD8806(void); // Empty constructor; init pins/strip length later
void
begin(void),
show(void),
setPixelColor(uint16_t n, uint8_t r, uint8_t g, uint8_t b),
setPixelColor(uint16_t n, uint8_t r, uint8_t g, uint8_t b, uint8_t r1, uint8_t r2, uint8_t r3, uint8_t r4, uint8_t r5, uint8_t r6, uint8_t r7, uint8_t r8),
setPixelColor(uint16_t n, uint32_t c),
setPixelColor(uint16_t n, uint32_t c, uint8_t r1, uint8_t r2, uint8_t r3, uint8_t r4, uint8_t r5, uint8_t r6, uint8_t r7, uint8_t r8),
updatePins(uint8_t dpin, uint8_t cpin), // Change pins, configurable
updatePins(void), // Change pins, hardware SPI
updateLength(uint16_t n); // Change strip length
uint16_t
numPixels(void);
uint32_t
Color(byte, byte, byte),
getPixelColor(uint16_t n);
 
private:
 
uint16_t
numLEDs; // Number of RGB LEDs in strip
uint8_t
*pixels, // Holds LED color values (3 bytes each)
clkpin , datapin, // Clock & data pin numbers
clkpinmask, datapinmask, // Clock & data PORT bitmasks
rigger, r1;
volatile uint8_t
*clkport , *dataport; // Clock & data PORT registers
void
startBitbang(void),
startSPI(void);
boolean
hardwareSPI, // If 'true', using hardware SPI
begun; // If 'true', begin() method was previously invoked
};