-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathanimation.ino
35 lines (34 loc) · 1.02 KB
/
animation.ino
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
void callAnimation(char animationChar) {
if ( lastAnimationChar != animationChar) {
FastLED.setBrightness( brightness ); // Inserir no single color?
FastLED.show();
}
switch (animationChar) {
case 's': // Solid
break;
case 'b': // Breathing
breathing();
break;
case 'w': // Wave
break;
case 'o': // Off
break;
}
lastAnimationChar = animationChar;
}
void breathing() {
t = millis();
if ( (t - tLast) > delayBreathing / 255) {
breathCount++;
Serial.print(breathCount); Serial.print(" "); Serial.println(sin8(breathCount));
FastLED.setBrightness( sin8(breathCount) * brightness / 255 );
FastLED.show();
tLast = millis();
}
}
//void wave() {
// for ( int i = 0; i < NUM_LEDS; i++) {
// leds[(i)].setRGB( map(i, 0, NUM_LEDS - 1, rgbDouble[0], rgbDouble[3]), map(i, 0, NUM_LEDS - 1, rgbDouble[1], rgbDouble[4]), map(i, 0, NUM_LEDS - 1, rgbDouble[2], rgbDouble[5]));
// }
// FastLED.show();
//}