FastLED 3.9.7
Loading...
Searching...
No Matches
TwinkleFox.ino
1#include "FastLED.h"
3
4using namespace fl;
5
6#define NUM_LEDS 100
7#define LED_TYPE WS2811
8#define COLOR_ORDER GRB
9#define DATA_PIN 3
10#define VOLTS 12
11#define MAX_MA 4000
12
14TwinkleFox twinkleFox(NUM_LEDS);
15
16void setup() {
17 delay(3000); // safety startup delay
19 FastLED.addLeds<LED_TYPE, DATA_PIN, COLOR_ORDER>(leds, NUM_LEDS)
20 .setCorrection(TypicalLEDStrip)
21 .setRgbw();
22}
23
24void loop() {
25 EVERY_N_SECONDS(SECONDS_PER_PALETTE) {
26 twinkleFox.chooseNextColorPalette(twinkleFox.targetPalette);
27 }
28 twinkleFox.draw(Fx::DrawContext(millis(), leds));
29 FastLED.show();
30}
CFastLED FastLED
Global LED strip management instance.
Definition FastLED.cpp:45
central include file for FastLED, defines the CFastLED class/object
void show(uint8_t scale)
Update all our controllers with the current led colors, using the passed in brightness.
Definition FastLED.cpp:94
void setMaxPowerInVoltsAndMilliamps(uint8_t volts, uint32_t milliamps)
Set the maximum power to be used, given in volts and milliamps.
Definition FastLED.h:732
static CLEDController & addLeds(CLEDController *pLed, struct CRGB *data, int nLedsOrOffset, int nLedsIfOffset=0)
Add a CLEDController instance to the world.
Definition FastLED.cpp:79
A version of CPixelView<CRGB> with an included array of CRGB LEDs.
Definition pixelset.h:460
void draw(DrawContext context) override
@ TypicalLEDStrip
Typical values for SMD5050 LEDs.
Definition color.h:19
#define EVERY_N_SECONDS(N)
Checks whether to execute a block of code every N seconds.
Definition lib8tion.h:1283
Implements a simple red square effect for 2D LED grids.
Definition crgb.h:16
Twinkling "holiday" lights that fade in and out.