FastLED 3.9.15
Loading...
Searching...
No Matches
FxCylon.ino
Go to the documentation of this file.
1
5
6#include <FastLED.h>
7#include "fx/1d/cylon.h"
8#include "fl/screenmap.h"
9
10using namespace fl;
11
12// How many leds in your strip?
13#define NUM_LEDS 64
14
15// For led chips like Neopixels, which have a data line, ground, and power, you just
16// need to define DATA_PIN. For led chipsets that are SPI based (four wires - data, clock,
17// ground, and power).
18#define DATA_PIN 2
19
20// Define the array of leds
22
23// Create a Cylon instance
25
26void setup() {
28 FastLED.addLeds<WS2812,DATA_PIN,RGB>(leds,NUM_LEDS).setRgbw().setScreenMap(screenMap);
29 FastLED.setBrightness(84);
30}
31
32void loop() {
33 cylon.draw(Fx::DrawContext(millis(), leds));
34 FastLED.show();
35 delay(cylon.delay_ms);
36}
CRGB leds[NUM_LEDS]
Definition Apa102.ino:11
#define NUM_LEDS
Definition Apa102.ino:6
CFastLED FastLED
Global LED strip management instance.
Definition FastLED.cpp:58
central include file for FastLED, defines the CFastLED class/object
fl::ScreenMap screenMap
void setup()
Definition FxCylon.ino:26
Cylon cylon(NUM_LEDS)
void loop()
Definition FxCylon.ino:32
WS2812 controller class.
Definition FastLED.h:210
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:33
@ RGB
Red, Green, Blue (0012)
Definition eorder.h:15
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:55