FastLED 3.9.7
|
Demonstrates an advanced ino file with multiple effects and UI elements.
This sketch is fully compatible with the FastLED web compiler. To use it do the following:
pip install fastled
fastled
Definition in file wasm.ino.
#include <stdio.h>
#include <string>
#include <FastLED.h>
#include "fx/2d/noisepalette.h"
#include "fl/json.h"
#include "fl/slice.h"
#include "fx/fx_engine.h"
#include "fx/2d/animartrix.hpp"
#include "fl/ui.h"
Go to the source code of this file.
Macros | |
#define | LED_PIN 3 |
#define | BRIGHTNESS 96 |
#define | COLOR_ORDER GRB |
#define | MATRIX_WIDTH 100 |
#define | MATRIX_HEIGHT 100 |
#define | GRID_SERPENTINE false |
#define | NUM_LEDS (MATRIX_WIDTH * MATRIX_HEIGHT) |
#define | SCALE 20 |
#define | SPEED 30 |
Functions | |
Description | description ("This example combines two features of FastLED to produce a remarkable range of effects from a relatively small amount of code. This example combines FastLED's color palette lookup functions with FastLED's Perlin noise generator, and the combination is extremely powerful") |
void | setup () |
void | loop () |
Variables | |
CRGB | leds [NUM_LEDS] |
XYMap | xyMap = XYMap::constructRectangularGrid(MATRIX_WIDTH, MATRIX_HEIGHT) |
NoisePalette | noisePalette = NoisePalette(xyMap) |
Title | title ("FastLED Wasm Demo") |
Slider | brightness ("Brightness", 255, 0, 255) |
Checkbox | isOff ("Off", false) |
Slider | speed ("Noise - Speed", 15, 1, 50) |
Checkbox | changePallete ("Noise - Auto Palette", true) |
Slider | changePalletTime ("Noise - Time until next random Palette", 5, 1, 100) |
Slider | scale ("Noise - Scale", 20, 1, 100) |
Button | changePalette ("Noise - Next Palette") |
Button | changeFx ("Switch between Noise & Animartrix") |
NumberField | fxIndex ("Animartrix - index", 0, 0, NUM_ANIMATIONS) |
Slider | timeSpeed ("Time Speed", 1, -10, 10,.1) |
Animartrix | animartrix (xyMap, POLAR_WAVES) |
FxEngine | fxEngine (NUM_LEDS) |
NoisePalette noisePalette = NoisePalette(xyMap) |