Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

42 lines (36 sloc) 1.309 kb
#include <Arduino.h>
class LEDStrip8806 {
public:
LEDStrip8806(uint16_t n, uint8_t dpin, uint8_t cpin); // Configurable pins
LEDStrip8806(uint16_t n); // Use SPI hardware; specific pins only
LEDStrip8806(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, uint32_t c),
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
numBytes; // Size of 'pixels' buffer below
uint8_t
*pixels, // Holds LED color values (3 bytes each) + latch
clkpin , datapin, // Clock & data pin numbers
clkpinmask, datapinmask; // Clock & data PORT bitmasks
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
};
Jump to Line
Something went wrong with that request. Please try again.