18#include "fx/2d/animartrix.hpp"
19#include "fx/fx_engine.h"
24#define LED_TYPE WS2811
25#define COLOR_ORDER GRB
27#define MATRIX_WIDTH 22
28#define MATRIX_HEIGHT 22
30#define NUM_LEDS (MATRIX_WIDTH * MATRIX_HEIGHT)
33#define IS_SERPINTINE false
35#define IS_SERPINTINE true
39Slider SCALE(
"SCALE", 20, 20, 100);
40Slider SPEED(
"SPEED", 30, 20, 100);
43XYMap xyMap(MATRIX_WIDTH, MATRIX_HEIGHT, IS_SERPINTINE);
53 .setScreenMap(MATRIX_WIDTH, MATRIX_HEIGHT);
55 noisePalette1.setPalettePreset(2);
56 noisePalette2.setPalettePreset(4);
57 fxEngine.
addFx(noisePalette1);
58 fxEngine.
addFx(noisePalette2);
62 noisePalette1.setSpeed(SPEED);
63 noisePalette1.setScale(SCALE);
64 noisePalette2.setSpeed(SPEED);
65 noisePalette2.setScale(
int(SCALE) * 3 / 2);
71 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.
bool nextFx(uint16_t transition_ms=500)
Transitions to the next effect in the sequence.
bool draw(uint32_t now, CRGB *outputBuffer)
Renders the current effect or transition to the output buffer.
@ TypicalLEDStrip
Typical values for SMD5050 LEDs.
#define EVERY_N_SECONDS(N)
Checks whether to execute a block of code every N seconds.
Implements a simple red square effect for 2D LED grids.
Demonstrates how to mix noise generation with color palettes on a 2D LED matrix.
Representation of an RGB pixel (Red, Green, Blue)