FastLED 3.9.15
Loading...
Searching...
No Matches
FxCylon.ino
Go to the documentation of this file.
1// @filter: (mem is large)
11
12#include <FastLED.h>
13#include "fl/fx/1d/cylon.h"
14#include "fl/math/screenmap.h"
15
16// How many leds in your strip?
17#define NUM_LEDS 64
18
19// For led chips like Neopixels, which have a data line, ground, and power, you just
20// need to define DATA_PIN. For led chipsets that are SPI based (four wires - data, clock,
21// ground, and power).
22#define DATA_PIN 2
23
24// Define the array of leds
26
27// Create a Cylon instance
29
30void setup() {
32 FastLED.addLeds<WS2812,DATA_PIN,RGB>(leds,NUM_LEDS).setRgbw().setScreenMap(screenMap);
33 FastLED.setBrightness(84);
34}
35
36void loop() {
37 cylon.draw(fl::Fx::DrawContext(millis(), leds));
38 FastLED.show();
39 delay(cylon.delay_ms);
40}
#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)
void setup()
Definition FxCylon.ino:30
void loop()
Definition FxCylon.ino:36
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