-
Notifications
You must be signed in to change notification settings - Fork 0
/
BasicPatterns.h
65 lines (50 loc) · 1022 Bytes
/
BasicPatterns.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
#ifndef _PATTERN_TYPES_H
#define _PATTERN_TYPES_H
void fadeall() {
for(int i = 0; i < NUM_LEDS; i++) {
leds[i].nscale8(250);
}
}
void ring() {
static uint8_t hue = 0;
for(int i = 0; i < NUM_LEDS / 2; i++) {
leds[i] = CHSV(hue++, 255, 255);
leds[i + (NUM_LEDS /2)] = CHSV(hue++, 255, 255);
FastLED.show();
fadeall();
delay(DELAY);
}
}
void ring_two() {
static uint8_t hue = 0;
for(int i = 0; i < NUM_LEDS / 2; i++) {
leds[i] = CHSV(hue++, 255, 255);
leds[i + (NUM_LEDS /2)] = CHSV(hue++, 255, 255);
FastLED.show();
leds[i] = CRGB::Black;
leds[i + (NUM_LEDS /2)] = CRGB::Black;
delay(DELAY);
}
}
void huefade() {
static uint8_t hue = 0;
for(int i = 0; i < NUM_LEDS; i++) {
leds[i] = CHSV(hue, 255, 255);
}
hue++;
FastLED.show();
delay(DELAY / 2);
}
void white() {
setColor(CRGB::White);
}
void red() {
setColor(CRGB::Red);
}
void blue() {
setColor(CRGB::Blue);
}
void green() {
setColor(CRGB::Green);
}
#endif