FastLED 3.9.3
Loading...
Searching...
No Matches
DemoReel100.ino
Go to the documentation of this file.
1
4
5#include <FastLED.h>
6#include "fx/1d/demoreel100.hpp"
7
8#define DATA_PIN 3
9//#define CLK_PIN 4
10#define LED_TYPE WS2811
11#define COLOR_ORDER GRB
12#define NUM_LEDS 64
13CRGB leds[NUM_LEDS];
14
15#define BRIGHTNESS 96
16#define FRAMES_PER_SECOND 120
17
18DemoReel100Ref demoReel = DemoReel100Ref::New(NUM_LEDS);
19
20void setup() {
21 delay(3000); // 3 second delay for recovery
22
23 // tell FastLED about the LED strip configuration
24 FastLED.addLeds<LED_TYPE,DATA_PIN,COLOR_ORDER>(leds, NUM_LEDS).setCorrection(TypicalLEDStrip).setRgbw();
25 //FastLED.addLeds<LED_TYPE,DATA_PIN,CLK_PIN,COLOR_ORDER>(leds, NUM_LEDS).setCorrection(TypicalLEDStrip);
26
27 // set master brightness control
28 FastLED.setBrightness(BRIGHTNESS);
29
30 // Initialize the DemoReel100 instance
31 demoReel->lazyInit();
32}
33
34void loop()
35{
36 // Run the DemoReel100 draw function
37 demoReel->draw(Fx::DrawContext(millis(), leds));
38
39 // send the 'leds' array out to the actual LED strip
40 FastLED.show();
41 // insert a delay to keep the framerate modest
42 FastLED.delay(1000/FRAMES_PER_SECOND);
43}
44
45
CFastLED FastLED
Global LED strip management instance.
Definition FastLED.cpp:33
central include file for FastLED, defines the CFastLED class/object
void delay(unsigned long ms)
Delay for the given number of milliseconds.
Definition FastLED.cpp:178
void setBrightness(uint8_t scale)
Set the global brightness scaling.
Definition FastLED.h:722
void show(uint8_t scale)
Update all our controllers with the current led colors, using the passed in brightness.
Definition FastLED.cpp:82
static CLEDController & addLeds(CLEDController *pLed, struct CRGB *data, int nLedsOrOffset, int nLedsIfOffset=0)
Add a CLEDController instance to the world.
Definition FastLED.cpp:67
@ TypicalLEDStrip
Typical values for SMD5050 LEDs.
Definition color.h:19
Representation of an RGB pixel (Red, Green, Blue)
Definition crgb.h:39