FastLED 3.9.15
Loading...
Searching...
No Matches
RGBSetDemo.ino
Go to the documentation of this file.
1
4
5#include <FastLED.h>
6#define NUM_LEDS 40
7
8#ifdef FASTLED_TESTING
9#define DELAY_MILLIS 1
10#else
11#define FASTLED_TESTING 33
12#endif
13
15
16void setup() { FastLED.addLeds<NEOPIXEL,2>(leds, NUM_LEDS); }
17
18void loop(){
19 static uint8_t hue;
20 for(int i = 0; i < NUM_LEDS/2; i++) {
21 // fade everything out
22 leds.fadeToBlackBy(40);
23
24 // let's set an led value
25 leds[i] = CHSV(hue++,255,255);
26
27 // now, let's first 20 leds to the top 20 leds,
28 leds(NUM_LEDS/2,NUM_LEDS-1) = leds(NUM_LEDS/2 - 1 ,0);
30 }
31}
void setup()
void loop()
#define NUM_LEDS
fl::CRGB leds[NUM_LEDS]
FL_DISABLE_WARNING_PUSH FL_DISABLE_WARNING_GLOBAL_CONSTRUCTORS CFastLED FastLED
Global LED strip management instance.
#define FASTLED_TESTING
uint8_t hue
Definition advanced.h:94
A version of CPixelView<CRGB> with an included array of CRGB LEDs.
Definition pixelset.h:496
fl::hsv8 CHSV
Definition chsv.h:11