FastLED 3.9.7
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
8using namespace fl;
9
10#define DATA_PIN 3
11//#define CLK_PIN 4
12#define LED_TYPE WS2811
13#define COLOR_ORDER GRB
14#define NUM_LEDS 64
15CRGB leds[NUM_LEDS];
16
17#define BRIGHTNESS 96
18#define FRAMES_PER_SECOND 120
19#define USES_RGBW 0
20
21#if USES_RGBW
22Rgbw rgbwMode = RgbwDefault();
23#else
24Rgbw rgbwMode = RgbwInvalid(); // No RGBW mode, just use RGB.
25#endif
26
27DemoReel100Ptr demoReel = DemoReel100Ptr::New(NUM_LEDS);
28
29void setup() {
30 delay(3000); // 3 second delay for recovery
31
32 // tell FastLED about the LED strip configuration
33 FastLED.addLeds<LED_TYPE,DATA_PIN,COLOR_ORDER>(leds, NUM_LEDS)
34 .setCorrection(TypicalLEDStrip)
35 .setRgbw(rgbwMode);
36
37 // set master brightness control
38 FastLED.setBrightness(BRIGHTNESS);
39}
40
41void loop()
42{
43 // Run the DemoReel100 draw function
44 demoReel->draw(Fx::DrawContext(millis(), leds));
45
46 // send the 'leds' array out to the actual LED strip
47 FastLED.show();
48 // insert a delay to keep the framerate modest
49 FastLED.delay(1000/FRAMES_PER_SECOND);
50}
51
52
CFastLED FastLED
Global LED strip management instance.
Definition FastLED.cpp:45
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:190
void setBrightness(uint8_t scale)
Set the global brightness scaling.
Definition FastLED.h:723
void show(uint8_t scale)
Update all our controllers with the current led colors, using the passed in brightness.
Definition FastLED.cpp:94
static CLEDController & addLeds(CLEDController *pLed, struct CRGB *data, int nLedsOrOffset, int nLedsIfOffset=0)
Add a CLEDController instance to the world.
Definition FastLED.cpp:79
@ TypicalLEDStrip
Typical values for SMD5050 LEDs.
Definition color.h:19
Implements a simple red square effect for 2D LED grids.
Definition crgb.h:16
Representation of an RGB pixel (Red, Green, Blue)
Definition crgb.h:54
Definition rgbw.h:28