Rev 1757 | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
1755 | - | 1 | Light Sequence Template: |
2 | |||
3 | Created by / Erstellt von: "Magomora" |
||
4 | |||
5 | Explanation / Erklärung: |
||
6 | ---------------------------------------------- |
||
7 | LED Läuft spiralförmig nach aussen |
||
8 | ---------------------------------------------- |
||
9 | |||
10 | Command / Befehl: |
||
11 | ---------------------------------------------- |
||
1770 | - | 12 | spiral( r, g, b, dly); |
1755 | - | 13 | ---------------------------------------------- |
14 | |||
15 | |||
16 | Code: |
||
17 | ---------------------------------------------- |
||
18 | void spiral( uint8_t r, uint8_t g, uint8_t b, uint8_t wait) { |
||
19 | uint8_t ri1, ri2, ri3, ri4, ri5, ri6, ri7, ri8; |
||
20 | |||
21 | for (uint8_t j=0; j< riggerSize ; j++){ |
||
22 | for (uint8_t i=1; i<= rigger ; i++){ |
||
23 | if (i == 1){ |
||
24 | strip.setPixelColor(j, r, g, b, 1, 0, 0, 0, 0, 0, 0, 0); |
||
25 | strip.show(); |
||
26 | delay ( wait ); |
||
27 | strip.setPixelColor(j, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0); |
||
28 | strip.show(); |
||
29 | delay ( wait ); |
||
30 | } |
||
31 | |||
32 | if (i == 2){ |
||
33 | strip.setPixelColor(j, r, g, b, 0, 1, 0, 0, 0, 0, 0, 0); |
||
34 | strip.show(); |
||
35 | delay ( wait ); |
||
36 | strip.setPixelColor(j, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0); |
||
37 | strip.show(); |
||
38 | delay ( wait ); |
||
39 | } |
||
40 | |||
41 | if (i == 3){ |
||
42 | strip.setPixelColor(j, r, g, b, 0, 0, 1, 0, 0, 0, 0, 0); |
||
43 | strip.show(); |
||
44 | delay ( wait ); |
||
45 | strip.setPixelColor(j, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0); |
||
46 | strip.show(); |
||
47 | delay ( wait ); |
||
48 | } |
||
49 | |||
50 | if (i == 4){ |
||
51 | strip.setPixelColor(j, r, g, b, 0, 0, 0, 1, 0, 0, 0, 0); |
||
52 | strip.show(); |
||
53 | delay ( wait ); |
||
54 | strip.setPixelColor(j, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0); |
||
55 | strip.show(); |
||
56 | delay ( wait ); |
||
57 | } |
||
58 | |||
59 | if (i == 5){ |
||
60 | strip.setPixelColor(j, r, g, b, 0, 0, 0, 0, 1, 0, 0, 0); |
||
61 | strip.show(); |
||
62 | delay ( wait ); |
||
63 | strip.setPixelColor(j, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0); |
||
64 | strip.show(); |
||
65 | delay ( wait ); |
||
66 | } |
||
67 | |||
68 | if (i == 6){ |
||
69 | strip.setPixelColor(j, r, g, b, 0, 0, 0, 0, 0, 1, 0, 0); |
||
70 | strip.show(); |
||
71 | delay ( wait ); |
||
72 | strip.setPixelColor(j, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0); |
||
73 | strip.show(); |
||
74 | delay ( wait ); |
||
75 | } |
||
76 | |||
77 | if (i == 7){ |
||
78 | strip.setPixelColor(j, r, g, b, 0, 0, 0, 0, 0, 0, 1, 0); |
||
79 | strip.show(); |
||
80 | delay ( wait ); |
||
81 | strip.setPixelColor(j, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0); |
||
82 | strip.show(); |
||
83 | delay ( wait ); |
||
84 | } |
||
85 | |||
86 | if (i == 8){ |
||
87 | strip.setPixelColor(j, r, g, b, 0, 0, 0, 0, 0, 0, 0, 1); |
||
88 | strip.show(); |
||
89 | delay ( wait ); |
||
90 | strip.setPixelColor(j, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1); |
||
91 | strip.show(); |
||
92 | delay ( wait ); |
||
93 | } |
||
94 | } |
||
95 | } |
||
96 | } |
||
97 | ---------------------------------------------- |