FastLED 3.9.7
Loading...
Searching...
No Matches
FxEngine.ino File Reference

Detailed Description

Demonstrates how to use the FxEngine to switch between different effects on a 2D LED matrix.

This example is compatible with the new FastLED wasm compiler. Install it by running pip install fastled then running fastled in this sketch directory.

Definition in file FxEngine.ino.

#include <FastLED.h>
#include "fx/2d/noisepalette.h"
#include "fx/2d/animartrix.hpp"
#include "fx/fx_engine.h"
#include "fl/ui.h"

Go to the source code of this file.

Macros

#define LED_PIN   2
 
#define BRIGHTNESS   96
 
#define LED_TYPE   WS2811
 
#define COLOR_ORDER   GRB
 
#define MATRIX_WIDTH   22
 
#define MATRIX_HEIGHT   22
 
#define NUM_LEDS   (MATRIX_WIDTH * MATRIX_HEIGHT)
 
#define IS_SERPINTINE   true
 

Functions

void setup ()
 
void loop ()
 

Variables

Slider SCALE ("SCALE", 20, 20, 100)
 
Slider SPEED ("SPEED", 30, 20, 100)
 
CRGB leds [NUM_LEDS]
 
XYMap xyMap (MATRIX_WIDTH, MATRIX_HEIGHT, IS_SERPINTINE)
 
NoisePalette noisePalette1 (xyMap)
 
NoisePalette noisePalette2 (xyMap)
 
FxEngine fxEngine (NUM_LEDS)
 
Checkbox switchFx ("Switch Fx", true)
 

Macro Definition Documentation

◆ BRIGHTNESS

#define BRIGHTNESS   96

Definition at line 23 of file FxEngine.ino.

◆ COLOR_ORDER

#define COLOR_ORDER   GRB

Definition at line 25 of file FxEngine.ino.

◆ IS_SERPINTINE

#define IS_SERPINTINE   true

Definition at line 35 of file FxEngine.ino.

◆ LED_PIN

#define LED_PIN   2

Definition at line 22 of file FxEngine.ino.

◆ LED_TYPE

#define LED_TYPE   WS2811

Definition at line 24 of file FxEngine.ino.

◆ MATRIX_HEIGHT

#define MATRIX_HEIGHT   22

Definition at line 28 of file FxEngine.ino.

◆ MATRIX_WIDTH

#define MATRIX_WIDTH   22

Definition at line 27 of file FxEngine.ino.

◆ NUM_LEDS

#define NUM_LEDS   (MATRIX_WIDTH * MATRIX_HEIGHT)

Definition at line 30 of file FxEngine.ino.

Function Documentation

◆ loop()

void loop ( )

Definition at line 61 of file FxEngine.ino.

◆ setup()

void setup ( )

Definition at line 49 of file FxEngine.ino.

Variable Documentation

◆ leds

CRGB leds[NUM_LEDS]

Definition at line 42 of file FxEngine.ino.