-
Notifications
You must be signed in to change notification settings - Fork 0
/
fastled_patterns.h
46 lines (38 loc) · 1 KB
/
fastled_patterns.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
int rainbow() {
static uint8_t hue = 0;
fill_rainbow( leds, NUM_LEDS, hue, 7);
hue++;
return 0;
}
int boa_rainbow() {
// kinda hacky, assumes boa has 64 LEDs with 2 strips of 32 folded over
static uint8_t hue = 0;
fill_rainbow( leds, 32, hue, 7);
for (int i=0; i<32; i++) {
leds[63-i] = leds[i];
}
hue++;
return 0;
}
int confetti() {
static uint8_t hue = 0;
// random colored speckles that blink in and fade smoothly
fadeToBlackBy( leds, NUM_LEDS, 7);
if (random8() > 100) {
int pos = random8(NUM_LEDS);
leds[pos] += CHSV( hue + random8(64), 200, 255);
}
hue++;
return 0;
}
int sinelon() {
static uint8_t hue = 0;
// a colored dot sweeping back and forth, with fading trails
fadeToBlackBy( leds, NUM_LEDS, 20);
int pos = beatsin16(11,0,NUM_LEDS);
leds[pos] |= CHSV( hue, 255, 255);
pos = beatsin16(13,0,NUM_LEDS);
leds[pos] |= CHSV( hue + 128, 255, 255);
hue++;
return 0;
}