FastLED 3.9.7
Loading...
Searching...
No Matches
Cylon.ino
Go to the documentation of this file.
1
4
5#include <FastLED.h>
6#include "fx/1d/cylon.hpp"
7
8using namespace fl;
9
10// How many leds in your strip?
11#define NUM_LEDS 64
12
13// For led chips like Neopixels, which have a data line, ground, and power, you just
14// need to define DATA_PIN. For led chipsets that are SPI based (four wires - data, clock,
15// ground, and power).
16#define DATA_PIN 2
17
18// Define the array of leds
19CRGB leds[NUM_LEDS];
20
21// Create a Cylon instance
22Cylon cylon(NUM_LEDS);
23
24void setup() {
25 FastLED.addLeds<WS2812,DATA_PIN,RGB>(leds,NUM_LEDS).setRgbw();
27}
28
29void loop() {
30 cylon.draw(Fx::DrawContext(millis(), leds));
31 FastLED.show();
32 delay(cylon.delay_ms);
33}
CFastLED FastLED
Global LED strip management instance.
Definition FastLED.cpp:45
central include file for FastLED, defines the CFastLED class/object
void setBrightness(uint8_t scale)
Set the global brightness scaling.
Definition FastLED.h:723
void show(uint8_t scale)
Update all our controllers with the current led colors, using the passed in brightness.
Definition FastLED.cpp:94
static CLEDController & addLeds(CLEDController *pLed, struct CRGB *data, int nLedsOrOffset, int nLedsIfOffset=0)
Add a CLEDController instance to the world.
Definition FastLED.cpp:79
WS2812 controller class.
Definition FastLED.h:190
An animation that moves a single LED back and forth (Larson Scanner effect)
Definition cylon.hpp:13
void draw(DrawContext context) override
Definition cylon.hpp:20
@ 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:54