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.
#include <FastLED.h>
#include "fx/1d/cylon.h"
#include "fl/screenmap.h"
using namespace fl;
// 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(Fx::DrawContext(millis(), leds));
FastLED.show();
delay(cylon.delay_ms);
}
CRGB leds[NUM_LEDS]
#define NUM_LEDS
void setup()
#define DATA_PIN
void loop()
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
Cylon cylon(NUM_LEDS)
WS2812 controller class.
Definition FastLED.h:218
An animation that moves a single LED back and forth (Larson Scanner effect)
Definition cylon.h:13
_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
@ RGB
Red, Green, Blue (0012)
Definition eorder.h:14
fl::ScreenMap screenMap
Definition Corkscrew.h:103
IMPORTANT!
Definition crgb.h:20
Representation of an RGB pixel (Red, Green, Blue)
Definition crgb.h:86