-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathArrowVersion2.ino
81 lines (72 loc) · 1.89 KB
/
ArrowVersion2.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
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
#include <FastLED.h>
#define LED_PIN_ARROW 3
#define NUM_LEDS_ARROW 126
#define BRIGHTNESS_ARROW 45
#define LED_TYPE WS2811
#define COLOR_ORDER RGB
CRGB arrow[NUM_LEDS_ARROW];
//--------Arrow------------
int index = 0;
void setup() {
FastLED.addLeds<LED_TYPE, LED_PIN_ARROW, COLOR_ORDER>(arrow, NUM_LEDS_ARROW).setCorrection( TypicalLEDStrip );
FastLED.setBrightness( BRIGHTNESS_ARROW );
}
void loop() {
int arrowIndex[3][2] = {
{0, 47},
{47, 85},
{85, 126}
};
for (int j = arrowIndex[index][0]; j < arrowIndex[index][1]; j++) {
arrow[j] = CRGB::White;
FastLED.show();
delay(5);
}
delay(300);
for (int j = arrowIndex[index][0]; j < arrowIndex[index][1]; j++) {
arrow[j] = CRGB::Black;
FastLED.show();
delay(5);
}
//delay(100);
index++;
if (index > 2) {
index = 0;
//------------------------------
for (int j = arrowIndex[index][0]; j < arrowIndex[index][1]; j++) {
arrow[j] = CRGB::White;
FastLED.show();
delay(5);
}
index++;
for (int j = arrowIndex[index][0]; j < arrowIndex[index][1]; j++) {
arrow[j] = CRGB::White;
FastLED.show();
delay(5);
}
index++;
for (int j = arrowIndex[index][0]; j < arrowIndex[index][1]; j++) {
arrow[j] = CRGB::White;
FastLED.show();
delay(5);
}
delay(500);
index = 0;
for (int j = arrowIndex[index][0]; j < arrowIndex[index][1]; j++) {
arrow[j] = CRGB::Black;
FastLED.show();
delay(5);
}
index++; for (int j = arrowIndex[index][0]; j < arrowIndex[index][1]; j++) {
arrow[j] = CRGB::Black;
FastLED.show();
delay(5);
}
index++; for (int j = arrowIndex[index][0]; j < arrowIndex[index][1]; j++) {
arrow[j] = CRGB::Black;
FastLED.show();
delay(5);
}
index = 0;
}
}