-
Notifications
You must be signed in to change notification settings - Fork 0
/
fade2black.ino
35 lines (28 loc) · 819 Bytes
/
fade2black.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
CRGBPalette16 bluePalette = CRGBPalette16 (
CRGB::MidnightBlue,
CRGB::Cyan,
CRGB::DarkTurquoise,
CRGB::Navy,
CRGB::Cyan,
CRGB::MediumBlue,
CRGB::SeaGreen,
CRGB::Teal,
CRGB::CadetBlue,
CRGB::Blue,
CRGB::DarkCyan,
CRGB::CornflowerBlue,
CRGB::Aquamarine,
CRGB::SeaGreen,
CRGB::Aqua,
CRGB::LightSkyBlue
);
CRGBPalette16 myPal2 = bluePalette;
void fadeToBlack2() {
EVERY_N_MILLISECONDS(50) {
// Switch on an LED at random, choosing a random color from the palette
leds[random8(0, LED_NUM - 1)] = ColorFromPalette(myPal2, random8(), 255, LINEARBLEND);
}
// Fade all LEDs down by 1 in brightness each time this is called
fadeToBlackBy(leds, LED_NUM, 1);
FastLED.show();
}