Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
1754 | - | 1 | #if (ARDUINO >= 100) |
2 | #include <Arduino.h> |
||
3 | #else |
||
4 | #include <WProgram.h> |
||
5 | #include <pins_arduino.h> |
||
6 | #endif |
||
7 | |||
8 | class LPD8806 { |
||
9 | |||
10 | public: |
||
11 | |||
12 | LPD8806(uint16_t n, uint8_t dpin, uint8_t cpin, uint8_t rig); // Configurable pins |
||
13 | LPD8806(uint16_t n, uint8_t rig); // Use SPI hardware; specific pins only |
||
14 | LPD8806(void); // Empty constructor; init pins/strip length later |
||
15 | void |
||
16 | begin(void), |
||
17 | show(void), |
||
18 | setPixelColor(uint16_t n, uint8_t r, uint8_t g, uint8_t b), |
||
19 | 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), |
||
20 | setPixelColor(uint16_t n, uint32_t c), |
||
21 | 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), |
||
22 | updatePins(uint8_t dpin, uint8_t cpin), // Change pins, configurable |
||
23 | updatePins(void), // Change pins, hardware SPI |
||
24 | updateLength(uint16_t n); // Change strip length |
||
25 | uint16_t |
||
26 | numPixels(void); |
||
27 | uint32_t |
||
28 | Color(byte, byte, byte), |
||
29 | getPixelColor(uint16_t n); |
||
30 | |||
31 | private: |
||
32 | |||
33 | uint16_t |
||
34 | numLEDs; // Number of RGB LEDs in strip |
||
35 | uint8_t |
||
36 | *pixels, // Holds LED color values (3 bytes each) |
||
37 | clkpin , datapin, // Clock & data pin numbers |
||
38 | clkpinmask, datapinmask, // Clock & data PORT bitmasks |
||
39 | rigger, r1; |
||
40 | volatile uint8_t |
||
41 | *clkport , *dataport; // Clock & data PORT registers |
||
42 | void |
||
43 | startBitbang(void), |
||
44 | startSPI(void); |
||
45 | boolean |
||
46 | hardwareSPI, // If 'true', using hardware SPI |
||
47 | begun; // If 'true', begin() method was previously invoked |
||
48 | }; |