FastLED 3.9.15
Loading...
Searching...
No Matches
FxCylon.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.
// @filter: (mem is large)
#include <FastLED.h>
#include "fl/fx/1d/cylon.h"
// How many leds in your strip?
#define NUM_LEDS 64
// For led chips like Neopixels, which have a data line, ground, and power, you just
// need to define DATA_PIN. For led chipsets that are SPI based (four wires - data, clock,
// ground, and power).
#define DATA_PIN 2
// Define the array of leds
// Create a Cylon instance
void setup() {
FastLED.addLeds<WS2812,DATA_PIN,RGB>(leds,NUM_LEDS).setRgbw().setScreenMap(screenMap);
FastLED.setBrightness(84);
}
void loop() {
cylon.draw(fl::Fx::DrawContext(millis(), leds));
FastLED.show();
delay(cylon.delay_ms);
}
void setup()
void loop()
#define NUM_LEDS
fl::CRGB leds[NUM_LEDS]
#define DATA_PIN
Definition ClientReal.h:82
FL_DISABLE_WARNING_PUSH FL_DISABLE_WARNING_GLOBAL_CONSTRUCTORS CFastLED FastLED
Global LED strip management instance.
fl::Cylon cylon(NUM_LEDS)
An animation that moves a single LED back and forth (Larson Scanner effect)
Definition cylon.h:11
::fl::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) FL_NOEXCEPT
constexpr EOrder RGB
Definition eorder.h:17
fl::ScreenMap screenMap
Definition Corkscrew.h:101
fl::CRGB CRGB
Definition crgb.h:25