FastLED 3.9.3
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
8// How many leds in your strip?
9#define NUM_LEDS 64
10
11// For led chips like Neopixels, which have a data line, ground, and power, you just
12// need to define DATA_PIN. For led chipsets that are SPI based (four wires - data, clock,
13// ground, and power).
14#define DATA_PIN 2
15
16// Define the array of leds
17CRGB leds[NUM_LEDS];
18
19// Create a Cylon instance
20CylonRef cylon = CylonRef::New(NUM_LEDS);
21
22void setup() {
23 FastLED.addLeds<WS2812,DATA_PIN,RGB>(leds,NUM_LEDS).setRgbw();
25}
26
27void loop() {
28 cylon->draw(Fx::DrawContext(millis(), leds));
29 FastLED.show();
30 delay(cylon->delay_ms);
31}
CFastLED FastLED
Global LED strip management instance.
Definition FastLED.cpp:33
central include file for FastLED, defines the CFastLED class/object
void setBrightness(uint8_t scale)
Set the global brightness scaling.
Definition FastLED.h:722
void show(uint8_t scale)
Update all our controllers with the current led colors, using the passed in brightness.
Definition FastLED.cpp:82
static CLEDController & addLeds(CLEDController *pLed, struct CRGB *data, int nLedsOrOffset, int nLedsIfOffset=0)
Add a CLEDController instance to the world.
Definition FastLED.cpp:67
WS2812 controller class.
Definition FastLED.h:189
Representation of an RGB pixel (Red, Green, Blue)
Definition crgb.h:39