Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
1769 | - | 1 | #include "LPD8806_kopterlight.h" |
2 | #include "SPI.h" |
||
3 | |||
4 | /*****************************************************************************/ |
||
5 | // Kopter light control on LPD8806-based RGB LED Modules in a strip! |
||
6 | /*****************************************************************************/ |
||
7 | |||
8 | /*****************************************************************************/ |
||
9 | // To be changed according to your setup |
||
10 | // The LED strips are 40 LEDs per meter but you can extend/cut the strip |
||
11 | |||
12 | #define rigger 1 // number of rigger (default: 4) |
||
13 | #define riggerSize 201 // Pixels / LEDs per rigger (default: 10) |
||
14 | |||
15 | #define stripSize (riggerSize*rigger) |
||
16 | |||
17 | // Use only if Hardware SPI is not possible |
||
18 | // int dataPin = 3; // Software SPI Data Pin |
||
19 | // int clockPin = 2; // Software SPI Clock Pin |
||
20 | // Soft SPI |
||
21 | // LPD8806 strip = LPD8806(stripSize, dataPin, clockPin, rigger); |
||
22 | |||
23 | // HW SPI |
||
24 | // on Arduino 168/328 thats data = 11, and clock = pin 13 |
||
25 | LPD8806 strip = LPD8806(stripSize, rigger); |
||
26 | |||
27 | /*****************************************************************************/ |
||
28 | //Do not change or remove these! |
||
29 | void setup() { |
||
30 | // Start up the LED strip |
||
31 | strip.begin(); |
||
32 | // Update the strip, to start they are all 'off' |
||
33 | strip.show(); |
||
34 | } |
||
35 | |||
36 | /*****************************************************************************/ |
||
37 | // Space for your light effects: |
||
38 | /*****************************************************************************/ |
||
39 | // Only inside Void Loop() you are allowed to design your light effects !! |
||
40 | // ( If you like to program a new pattern or sequences, refer to sequences.ino) |
||
41 | /*****************************************************************************/ |
||
42 | // Parameter: Colors are defined by the additive RGB color model. |
||
43 | // n = LED No on rigger |
||
44 | // r = red ( max. 127) |
||
45 | // g = green ( max. 127) |
||
46 | // b = blue ( max. 127) |
||
47 | // dly = delay ( typical: 10 - 50 ) |
||
48 | // cyl = cyles ( how many times this sequence will repeat ) |
||
49 | // riX = rigger to set pixel / to show sequence on x= number of rigger |
||
50 | /*****************************************************************************/ |
||
51 | void loop() { |
||
52 | |||
53 | clearstrip (); |
||
54 | fadein(90,0,0,6,1,0,0,0,0,0,0,0); // red |
||
55 | fadeout(90,0,0,6,1,0,0,0,0,0,0,0); // red |
||
56 | fadein(0,90,0,6,1,0,0,0,0,0,0,0); // green |
||
57 | fadeout(0,90,0,6,1,0,0,0,0,0,0,0); // green |
||
58 | fadein(0,0,90,6,1,0,0,0,0,0,0,0); // blue |
||
59 | fadeout(0,0,90,6,1,0,0,0,0,0,0,0); // blue |
||
60 | |||
61 | colorChaseRev(127,0,0,50,1,0,0,0,0,0,0,0); // red |
||
62 | colorChase(0,127,0,50,1,0,0,0,0,0,0,0); // green |
||
63 | colorChaseRev(0,0,127,50,1,0,0,0,0,0,0,0); // blue |
||
64 | |||
65 | } |
||
66 | /*****************************************************************************/ |
||
67 | |||
68 | |||
69 | |||
70 |