FastLED 3.9.7
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"

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)
 

Macro Definition Documentation

◆ BRIGHTNESS

#define BRIGHTNESS   96

Definition at line 28 of file wasm.ino.

◆ COLOR_ORDER

#define COLOR_ORDER   GRB

Definition at line 29 of file wasm.ino.

◆ GRID_SERPENTINE

#define GRID_SERPENTINE   false

Definition at line 33 of file wasm.ino.

◆ LED_PIN

#define LED_PIN   3

Definition at line 27 of file wasm.ino.

◆ MATRIX_HEIGHT

#define MATRIX_HEIGHT   100

Definition at line 32 of file wasm.ino.

◆ MATRIX_WIDTH

#define MATRIX_WIDTH   100

Definition at line 31 of file wasm.ino.

◆ NUM_LEDS

#define NUM_LEDS   (MATRIX_WIDTH * MATRIX_HEIGHT)

Definition at line 35 of file wasm.ino.

◆ SCALE

#define SCALE   20

Definition at line 66 of file wasm.ino.

◆ SPEED

#define SPEED   30

Definition at line 72 of file wasm.ino.

Function Documentation

◆ loop()

void loop ( )

Definition at line 110 of file wasm.ino.

◆ setup()

void setup ( )

Definition at line 95 of file wasm.ino.

Variable Documentation

◆ leds

CRGB leds[NUM_LEDS]

Definition at line 74 of file wasm.ino.

◆ noisePalette

NoisePalette noisePalette = NoisePalette(xyMap)

Definition at line 76 of file wasm.ino.

◆ xyMap

XYMap xyMap = XYMap::constructRectangularGrid(MATRIX_WIDTH, MATRIX_HEIGHT)

Definition at line 75 of file wasm.ino.