FastLED 3.9.15
Loading...
Searching...
No Matches
FxDemoReel100.ino

This sketch is fully compatible with the FastLED web compiler.

This sketch is fully compatible with the FastLED web compiler. To use it do the following:

  1. Install Fastled: pip install fastled
  2. cd into this examples page.
  3. Run the FastLED web compiler at root: fastled
  4. When the compiler is done a web page will open.
#include <FastLED.h>
#include "fl/screenmap.h"
#include "defs.h" // for NUM_LEDS
#if !HAS_ENOUGH_MEMORY
void setup() {}
void loop() {}
#else
using namespace fl;
#define DATA_PIN 3
//#define CLK_PIN 4
#define LED_TYPE WS2811
#define COLOR_ORDER GRB
#define NUM_LEDS 64
#define BRIGHTNESS 96
#define FRAMES_PER_SECOND 120
#define USES_RGBW 0
#if USES_RGBW
Rgbw rgbwMode = RgbwDefault();
#else
Rgbw rgbwMode = RgbwInvalid(); // No RGBW mode, just use RGB.
#endif
DemoReel100Ptr demoReel = fl::make_shared<DemoReel100>(NUM_LEDS);
void setup() {
// tell FastLED about the LED strip configuration
.setCorrection(TypicalLEDStrip)
.setScreenMap(screenMap)
.setRgbw(rgbwMode);
// set master brightness control
FastLED.setBrightness(BRIGHTNESS);
}
void loop()
{
// Run the DemoReel100 draw function
demoReel->draw(Fx::DrawContext(millis(), leds));
// send the 'leds' array out to the actual LED strip
FastLED.show();
// insert a delay to keep the framerate modest
FastLED.delay(1000/FRAMES_PER_SECOND);
}
#endif // HAS_ENOUGH_MEMORY
CRGB leds[NUM_LEDS]
#define NUM_LEDS
void setup()
#define DATA_PIN
void loop()
#define BRIGHTNESS
Definition Blur.ino:8
#define FRAMES_PER_SECOND
FL_DISABLE_WARNING_PUSH FL_DISABLE_WARNING_GLOBAL_CONSTRUCTORS CFastLED FastLED
Global LED strip management instance.
Definition FastLED.cpp:74
central include file for FastLED, defines the CFastLED class/object
#define COLOR_ORDER
Definition advanced.h:42
#define LED_TYPE
Definition advanced.h:41
_DrawContext DrawContext
Definition fx.h:21
static ScreenMap DefaultStrip(int numLeds, float cm_between_leds=1.5f, float cm_led_diameter=0.2f, float completion=.9f)
Definition screenmap.h:40
fl::ScreenMap screenMap
Definition Corkscrew.h:103
@ TypicalLEDStrip
Typical values for SMD5050 LEDs.
Definition color.h:19
shared_ptr< T > make_shared(Args &&... args)
Definition shared_ptr.h:348
IMPORTANT!
Definition crgb.h:20
Representation of an RGB pixel (Red, Green, Blue)
Definition crgb.h:86
Definition rgbw.h:26