FastLED 3.9.15
Loading...
Searching...
No Matches
wasm.ino File Reference

Detailed Description

Demonstrates an advanced ino file with multiple effects and UI elements.

Author
Zach Vorhies

This sketch is fully compatible with the FastLED web compiler. To use it do the following:

  1. Install Fastled: pip install fastled
  2. cd into this examples page.
  3. Run the FastLED web compiler at root: fastled
  4. When the compiler is done a web page will open.

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"
+ Include dependency graph for wasm.ino:

Go to the source code of this file.

Macros

#define BRIGHTNESS   96
 
#define COLOR_ORDER   GRB
 
#define GRID_SERPENTINE   false
 
#define LED_PIN   3
 
#define MATRIX_HEIGHT   100
 
#define MATRIX_WIDTH   100
 
#define NUM_LEDS   (MATRIX_WIDTH * MATRIX_HEIGHT)
 
#define SCALE   20
 
#define SPEED   30
 

Functions

UIDescription 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 loop ()
 
void setup ()
 

Variables

Animartrix animartrix (xyMap, POLAR_WAVES)
 
UISlider brightness ("Brightness", 255, 0, 255)
 
UIButton changeFx ("Switch between Noise & Animartrix")
 
UIButton changePalette ("Noise - Next Palette")
 
UICheckbox changePallete ("Noise - Auto Palette", true)
 
UISlider changePalletTime ("Noise - Time until next random Palette", 5, 1, 100)
 
FxEngine fxEngine (NUM_LEDS)
 
UINumberField fxIndex ("Animartrix - index", 0, 0, NUM_ANIMATIONS)
 
UICheckbox isOff ("Off", false)
 
CRGB leds [NUM_LEDS]
 
NoisePalette noisePalette = NoisePalette(xyMap)
 
UISlider scale ("Noise - Scale", 20, 1, 100)
 
UISlider speed ("Noise - Speed", 15, 1, 50)
 
UISlider timeSpeed ("Time Speed", 1, -10, 10,.1)
 
UITitle title ("FastLED Wasm Demo")
 
XYMap xyMap = XYMap::constructRectangularGrid(MATRIX_WIDTH, MATRIX_HEIGHT)