This repository has been archived by the owner on Feb 22, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
RainbowDanceParty.h
116 lines (108 loc) · 3.16 KB
/
RainbowDanceParty.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
#ifndef RAINBOW_DANCE_PARTY_H
#define RAINBOW_DANCE_PARTY_H
#include "common.h"
#include "Mode.h"
//this is going to look totally bangin
class RainbowDanceParty:public Mode{
public:
void start(){
int maxim=NUM_LEDS/2;//Theres enough mention of it to warrant its own declaraion
if(maxim%2==1){
leds[maxim-1].r=132,
leds[maxim-1].g=112,
leds[maxim-1].b=255;
leds[maxim].r=148, //CREATE THE SINGULARITY
leds[maxim].g=0, //CREATE IF ODD
leds[maxim].b=211;
leds[maxim+1].r=132,
leds[maxim+1].g=112,
leds[maxim+1].b=255;
}else{
leds[maxim-1].r=132,
leds[maxim-1].g=112,
leds[maxim-1].b=255;
leds[maxim].r=148, //CREATE IF EVEN
leds[maxim].g=0,
leds[maxim].b=211;
leds[maxim+1].r=148,
leds[maxim+1].g=0,
leds[maxim+1].b=211;
leds[maxim+2].r=132,
leds[maxim+2].g=112,
leds[maxim+2].b=255;
}
FastLED.show();
for(byte i=1;i<maxim;i++){
leds[i].r=255,
leds[i].b=255,
leds[i].g=255;
leds[i-1].r=0,
leds[i-1].b=0,
leds[i-1].g=0; //HERE COME THE DOUBLE PARTICLES
leds[NUM_LEDS-i].r=255,
leds[NUM_LEDS-i].b=255,
leds[NUM_LEDS-i].g=255;
leds[NUM_LEDS-i+1].r=0,
leds[NUM_LEDS-i+1].b=0,
leds[NUM_LEDS-i+1].g=0;
FastLED.show();
delay(5);//DRAMATIC EFFECT
}
double changeFactor=255/(maxim/6);
for(byte i=1;i<maxim/6;i++){
leds[maxim+i].g=255;
leds[maxim+i].r=changeFactor*i;
leds[maxim+i].b=0;
leds[maxim-i].g=255;
leds[maxim-i].r=changeFactor*i;
leds[maxim-i].b=0;
FastLED.show();
}
for(byte i=maxim/6;i<maxim/3;i++){
leds[maxim+i].g=255-(changeFactor*i);
leds[maxim+i].r=255;
leds[maxim+i].b=0;
leds[maxim-i].g=255-(changeFactor*i);
leds[maxim-i].r=255;
leds[maxim-i].b=0;
FastLED.show();
}
for(byte i=maxim/3;i<maxim/2;i++){
leds[maxim+i].g=0;
leds[maxim+i].r=255;
leds[maxim+i].b=changeFactor*i;
leds[maxim-i].g=0;
leds[maxim-i].r=255;
leds[maxim-i].b=changeFactor*i;
FastLED.show();
}
for(byte i=maxim/2;i<2*maxim/3;i++){
leds[maxim+i].g=0;
leds[maxim+i].r=255-changeFactor*i;
leds[maxim+i].b=255;
leds[maxim-i].g=0;
leds[maxim-i].r=255-changeFactor*i;
leds[maxim-i].b=255;
FastLED.show();
}
for(byte i=2*maxim/3;i<5*maxim/6;i++){
leds[maxim+i].g=changeFactor*i;
leds[maxim+i].r=0;
leds[maxim+i].b=255;
leds[maxim-i].g=changeFactor*i;
leds[maxim-i].r=0;
leds[maxim-i].b=255;
FastLED.show();
}
for(byte i=5*maxim/6;i<maxim;i++){
leds[maxim+i].g=255;
leds[maxim+i].r=0;
leds[maxim+i].b=255-changeFactor*i;
leds[maxim-i].g=255;
leds[maxim-i].r=0;
leds[maxim-i].b=255-changeFactor*i;
FastLED.show();
}
}
};
#endif