18#include "fx/fx_engine.h"
20#include "fx/2d/animartrix.hpp"
28#define COLOR_ORDER GRB
30#define MATRIX_WIDTH 22
31#define MATRIX_HEIGHT 22
33#define NUM_LEDS (MATRIX_WIDTH * MATRIX_HEIGHT)
35#define FIRST_ANIMATION POLAR_WAVES
39XYMap xyMap = XYMap::constructRectangularGrid(MATRIX_WIDTH, MATRIX_HEIGHT);
42Title title(
"Animartrix");
43Description description(
"Demo of the Animatrix effects. @author of fx is StefanPetrick");
45Slider brightness(
"Brightness", 255, 0, 255);
46NumberField fxIndex(
"Animartrix - index", 0, 0, NUM_ANIMATIONS - 1);
47Slider timeSpeed(
"Time Speed", 1, -10, 10, .1);
57 fxEngine.
addFx(animartrix);
63 static int lastFxIndex = -1;
64 if (fxIndex.value() != lastFxIndex) {
65 lastFxIndex = fxIndex;
66 animartrix.fxSet(fxIndex);
68 fxEngine.
draw(millis(), leds);
CFastLED FastLED
Global LED strip management instance.
central include file for FastLED, defines the CFastLED class/object
void setBrightness(uint8_t scale)
Set the global brightness scaling.
void show(uint8_t scale)
Update all our controllers with the current led colors, using the passed in brightness.
static CLEDController & addLeds(CLEDController *pLed, struct CRGB *data, int nLedsOrOffset, int nLedsIfOffset=0)
Add a CLEDController instance to the world.
Manages and renders multiple visual effects (Fx) for LED strips.
int addFx(FxPtr effect)
Adds a new effect to the engine.
void setSpeed(float scale)
Sets the speed of the fx engine, which will impact the speed of all effects.
bool draw(uint32_t now, CRGB *outputBuffer)
Renders the current effect or transition to the output buffer.
@ TypicalLEDStrip
Typical values for SMD5050 LEDs.
Implements a simple red square effect for 2D LED grids.
Representation of an RGB pixel (Red, Green, Blue)