forked from adafruit/LPD8806
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of github.com:adafruit/LPD8806
- Loading branch information
Showing
5 changed files
with
195 additions
and
135 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,43 @@ | ||
#if (ARDUINO <= 22) | ||
#include <WProgram.h> | ||
#else | ||
#if (ARDUINO >= 100) | ||
#include <Arduino.h> | ||
#else | ||
#include <WProgram.h> | ||
#endif | ||
|
||
class LPD8806 { | ||
private: | ||
void write8(byte); | ||
// the arrays of bytes that hold each LED's 24 bit color values | ||
uint8_t *pixels; | ||
uint16_t numLEDs; | ||
uint8_t dataPin, clockPin; | ||
volatile uint8_t *clkportreg, *mosiportreg; | ||
uint8_t clkpin, mosipin; | ||
boolean hardwareSPI; | ||
|
||
void writezeros(uint16_t n); | ||
|
||
public: | ||
|
||
LPD8806(uint16_t n, uint8_t dpin, uint8_t cpin); | ||
LPD8806(uint16_t n); | ||
void begin(); | ||
void show(); | ||
void setPixelColor(uint16_t n, uint8_t r, uint8_t g, uint8_t b); | ||
void setPixelColor(uint16_t n, uint32_t c); | ||
uint16_t numPixels(void); | ||
uint32_t Color(byte, byte, byte); | ||
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); | ||
uint16_t | ||
numPixels(void); | ||
uint32_t | ||
Color(byte, byte, byte); | ||
|
||
boolean | ||
slowmo; // If true, use digitalWrite instead of direct PORT writes | ||
uint8_t | ||
pause; // Delay (in milliseconds) after latch | ||
|
||
private: | ||
|
||
uint8_t | ||
*pixels; // Holds LED color values | ||
uint16_t | ||
numLEDs; // Number of RGB LEDs in strand | ||
boolean | ||
hardwareSPI; // If true, using hardware SPI, the following are ignored: | ||
uint8_t | ||
datapin, datapinmask, clockpin, clockpinmask; | ||
volatile uint8_t | ||
*clockport, *dataport; | ||
|
||
void | ||
writezeros(uint16_t n); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Arduino library for LPD8806 # | ||
This Library was written for the LPD8806 PWM LED driver chips, strips and pixels. | ||
But the LPD8803/LPD8809 will probably work too. | ||
|
||
## Where to Buy? ## | ||
Pick some up at [Adafruit Industries](http://www.adafruit.com/products/306) | ||
|
||
## Download ## | ||
Click the Downloads Tab in the Tabbar above. | ||
Or follow [this](https://github.com/adafruit/LPD8806/zipball/master) link | ||
|
||
## Installation ## | ||
* Uncompress the Downloaded Library | ||
* Rename the uncompressed folder to LPD8806 | ||
* Check that the LPD8806 folder contains LPD8806.cpp and LPD8806.h | ||
* Place the LPD8806 library folder your <arduinosketchfolder>/libraries/ folder, | ||
if the libraries folder does not exist - create it first! | ||
* Restart the IDE |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.