SHOW:
|
|
- or go back to the newest paste.
1 | #include "FastLED.h" | |
2 | #define NUM_LEDS 31 | |
3 | #define DATA_PIN 5 | |
4 | #define CLOCK_PIN 6 | |
5 | #define BLUE Red | |
6 | #define RED Blue | |
7 | #define GREEN Green | |
8 | ||
9 | ||
10 | CRGB leds[NUM_LEDS]; | |
11 | ||
12 | void setup() | |
13 | { | |
14 | FastLED.addLeds<WS2801, DATA_PIN, CLOCK_PIN, RGB>(leds, NUM_LEDS); | |
15 | Serial.begin(9600); | |
16 | } | |
17 | ||
18 | void loop() | |
19 | { | |
20 | for (int i = 0; i <= NUM_LEDS; i++) | |
21 | { | |
22 | leds[i] = CRGB::Fuchsia ; | |
23 | FastLED.show(); | |
24 | delay(30); | |
25 | leds[i] = CRGB::Black; | |
26 | - | Serial.println(i); |
26 | + | |
27 | ||
28 | } | |
29 | ||
30 | for (int i = NUM_LEDS; i >= 0; i--) | |
31 | { | |
32 | leds[i] = CRGB::Fuchsia ; | |
33 | FastLED.show(); | |
34 | delay(30); | |
35 | - | Serial.println(i); |
35 | + | |
36 | FastLED.show(); | |
37 | } | |
38 | } |