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

Detailed Description

2D flow field visualization: emitters paint color, noise advects it

Definition in file FlowField.ino.

#include <FastLED.h>
#include "fl/ui/ui.h"
#include "fl/fx/2d/flowfield.h"
+ Include dependency graph for FlowField.ino:

Go to the source code of this file.

Macros

#define BRIGHTNESS   255
 
#define DATA_PIN   2
 
#define HEIGHT   64
 
#define NUM_LEDS   (WIDTH * HEIGHT)
 
#define SERPENTINE   true
 
#define WIDTH   64
 

Functions

fl::UIDescription description ("Flow field visualization with noise-driven advection, creating fluid-like patterns from color emitters. " "Concept by Stefan Petrick, Initial C++ implementation by 4wheeljive. FastLED port adaptation + fixed point " "optmization by Zach Vorhies.")
 
void loop ()
 
void setup ()
 

Variables

fl::UIGroup appearanceGroup ("Appearance", endpointSpeed, colorShift, persistence, flowShift, numDots, emitterMode)
 
fl::UISlider colorShift ("Color Shift", 0.04f, 0.0f, 0.5f, 0.01f)
 
fl::UIDropdown computeMode ("Compute Mode", {"Float", "Fixed-Point (Fast)"})
 
fl::UIGroup debugGroup ("Debug", computeMode, showFlowVectors)
 
fl::UIDropdown emitterMode ("Emitter Mode", {"Lissajous", "Dots", "Both"})
 
fl::UISlider endpointSpeed ("Endpoint Speed", 0.80f, 0.05f, 2.0f, 0.01f)
 
fl::UISlider flowAmpX ("X Amplitude", 1.0f, 0.0f, 2.0f, 0.01f)
 
fl::UISlider flowAmpY ("Y Amplitude", 1.0f, 0.0f, 2.0f, 0.01f)
 
fl::FlowFieldFloat flowFieldFloat (xyMap)
 
fl::FlowFieldFP flowFieldFP (xyMap)
 
fl::UISlider flowFreqX ("X Frequency", 0.33f, 0.05f, 4.0f, 0.01f)
 
fl::UISlider flowFreqY ("Y Frequency", 0.32f, 0.05f, 4.0f, 0.01f)
 
fl::UISlider flowShift ("Pixel Shift", 1.8f, 0.5f, 4.0f, 0.1f)
 
fl::UISlider flowSpeedX ("X Speed", 0.10f, -2.0f, 2.0f, 0.01f)
 
fl::UISlider flowSpeedY ("Y Speed", 0.10f, -2.0f, 2.0f, 0.01f)
 
fl::UIGroup flowXGroup ("Flow X", flowSpeedX, flowAmpX, flowFreqX)
 
fl::UIGroup flowYGroup ("Flow Y", flowSpeedY, flowAmpY, flowFreqY)
 
CRGB leds [NUM_LEDS]
 
fl::UIButton noisePunch ("NoisePunch")
 
fl::UISlider numDots ("Dots", 3, 1, 5, 1)
 
fl::UISlider persistence ("Trail Half-Life (s)", 0.86f, 0.05f, 5.0f, 0.01f)
 
fl::UICheckbox showFlowVectors ("Show Flow Vectors", false)
 
fl::UITitle title ("FlowFields")
 
fl::XYMap xyMap (WIDTH, HEIGHT, SERPENTINE)