-
Notifications
You must be signed in to change notification settings - Fork 0
/
shifting_rgb.cpp
37 lines (36 loc) · 860 Bytes
/
shifting_rgb.cpp
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
//*****************************************************************************
// shifting r,g,b
//*****************************************************************************
#include "FastLED.h"
#include "common.h"
#include "shifting_rgb.h"
#include "DebugMacros.h"
void shifting_rgb()
{
DPRINTLN_L("shifting_rgb:");
int dt = 300;
for (byte i = 0; i < NUM_LEDS-1;)
{
leds[i] = CRGB::Red; // red
leds[i + 2] = CRGB::Black; // off
i += 3;
}
FastLED.show();
delay(dt);
for (byte i = 0; i < NUM_LEDS-1;)
{
leds[i] = CRGB::Black; // off
leds[i + 1] = CRGB::Green; // green
i += 3;
}
FastLED.show();
delay(dt);
for (byte i = 0; i < NUM_LEDS-1;)
{
leds[i + 1] = CRGB::Black; // off
leds[i + 2] = CRGB::Blue; // blue
i += 3;
}
FastLED.show();
delay(dt);
}