FastLED 3.9.15
Loading...
Searching...
No Matches
advanced.h
Go to the documentation of this file.
1
4
5#include <Arduino.h>
6#include <FastLED.h>
7
8
9
10#include "fl/ui.h"
11#include "fl/audio.h"
12#include "fl/fft.h"
13#include "fl/xymap.h"
14#include "fl/math.h"
15#include "fl/math_macros.h"
16
17#include "fl/compiler_control.h"
18
19// This is used by fastled because we have extremely strict compiler settings.
20// Stock Arduino/Platformio does not need these.
22FL_DISABLE_WARNING(float-conversion)
23FL_DISABLE_WARNING(sign-conversion)
24FL_DISABLE_WARNING(implicit-float-conversion)
25FL_DISABLE_WARNING(implicit-int-float-conversion)
26
27
28using namespace fl;
29
30// Display configuration
31// For WebAssembly, use a smaller display to avoid memory issues
32#ifdef __EMSCRIPTEN__
33#define WIDTH 32
34#define HEIGHT 32
35#else
36#define WIDTH 64
37#define HEIGHT 64
38#endif
39#define NUM_LEDS (WIDTH * HEIGHT)
40#define LED_PIN 3
41#define LED_TYPE WS2812B
42#define COLOR_ORDER GRB
43
44// Audio configuration
45#define SAMPLE_RATE 44100
46#define FFT_SIZE 512
47
48// UI Elements
49UITitle title("Audio Reactive Visualizations");
50UIDescription description("Real-time audio visualizations with beat detection and multiple modes");
51
52// Master controls
53UICheckbox enableAudio("Enable Audio", true);
54UIDropdown visualMode("Visualization Mode",
55 {"Spectrum Bars", "Radial Spectrum", "Waveform", "VU Meter", "Matrix Rain", "Fire Effect", "Plasma Wave"});
56
57// Audio controls
58UISlider audioGain("Audio Gain", 1.0f, 0.1f, 5.0f, 0.1f);
59UISlider noiseFloor("Noise Floor", 0.1f, 0.0f, 1.0f, 0.01f);
60UICheckbox autoGain("Auto Gain", true);
61
62// Visual controls
63UISlider brightness("Brightness", 128, 0, 255, 1);
64UISlider fadeSpeed("Fade Speed", 20, 0, 255, 1);
65UIDropdown colorPalette("Color Palette",
66 {"Rainbow", "Heat", "Ocean", "Forest", "Party", "Lava", "Cloud"});
67UICheckbox mirrorMode("Mirror Mode", false);
68
69// Beat detection
70UICheckbox beatDetect("Beat Detection", true);
71UISlider beatSensitivity("Beat Sensitivity", 1.5f, 0.5f, 3.0f, 0.1f);
72UICheckbox beatFlash("Beat Flash", true);
73
74// Audio input
75UIAudio audio("Audio Input");
76
77// Global variables
81
82// Audio processing variables - keep these smaller for WebAssembly
83static const int NUM_BANDS = 16; // Reduced from 32
84float fftSmooth[NUM_BANDS] = {0};
85float beatHistory[20] = {0}; // Reduced from 43
87float beatAverage = 0;
88float beatVariance = 0;
89uint32_t lastBeatTime = 0;
90bool isBeat = false;
91float autoGainValue = 1.0f;
92float peakLevel = 0;
93
94// Visual effect variables
95uint8_t hue = 0;
96// Remove large static arrays for WebAssembly
97#ifndef __EMSCRIPTEN__
98float plasma[WIDTH][HEIGHT] = {{0}};
99uint8_t fireBuffer[WIDTH][HEIGHT] = {{0}};
100#endif
101
102// Get current color palette
103CRGBPalette16 getCurrentPalette() {
104 switch(colorPalette.as_int()) {
105 case 0: return CRGBPalette16(RainbowColors_p);
106 case 1: return CRGBPalette16(HeatColors_p);
107 case 2: return CRGBPalette16(OceanColors_p);
108 case 3: return CRGBPalette16(ForestColors_p);
109 case 4: return CRGBPalette16(PartyColors_p);
110 case 5: return CRGBPalette16(LavaColors_p);
111 case 6: return CRGBPalette16(CloudColors_p);
112 default: return CRGBPalette16(RainbowColors_p);
113 }
114}
115
116// Beat detection algorithm
117bool detectBeat(float energy) {
120
121 // Calculate average
122 beatAverage = 0;
123 for (int i = 0; i < 20; i++) {
125 }
126 beatAverage /= 20.0f;
127
128 // Calculate variance
129 beatVariance = 0;
130 for (int i = 0; i < 20; i++) {
131 float diff = beatHistory[i] - beatAverage;
132 beatVariance += diff * diff;
133 }
134 beatVariance /= 20.0f;
135
136 // Detect beat
137 float threshold = beatAverage + (beatSensitivity.value() * sqrt(beatVariance));
138 uint32_t currentTime = millis();
139
140 if (energy > threshold && (currentTime - lastBeatTime) > 80) {
141 lastBeatTime = currentTime;
142 return true;
143 }
144 return false;
145}
146
147// Update auto gain
148void updateAutoGain(float level) {
149 if (!autoGain) {
150 autoGainValue = 1.0f;
151 return;
152 }
153
154 static float targetLevel = 0.7f;
155 static float avgLevel = 0.0f;
156
157 avgLevel = avgLevel * 0.95f + level * 0.05f;
158
159 if (avgLevel > 0.01f) {
160 float gainAdjust = targetLevel / avgLevel;
161 gainAdjust = fl::clamp(gainAdjust, 0.5f, 2.0f);
162 autoGainValue = autoGainValue * 0.9f + gainAdjust * 0.1f;
163 }
164}
165
166// Clear display
168 if (fadeSpeed.as_int() == 0) {
170 } else {
172 }
173}
174
175// Visualization: Spectrum Bars
176void drawSpectrumBars(FFTBins* fft, float /* peak */) {
177 clearDisplay();
178 CRGBPalette16 palette = getCurrentPalette();
179
180 int barWidth = WIDTH / NUM_BANDS;
181
182 for (size_t band = 0; band < NUM_BANDS && band < fft->bins_db.size(); band++) {
183 float magnitude = fft->bins_db[band];
184
185 // Apply noise floor
186 magnitude = magnitude / 100.0f; // Normalize from dB
187 magnitude = MAX(0.0f, magnitude - noiseFloor.value());
188
189 // Smooth the FFT
190 fftSmooth[band] = fftSmooth[band] * 0.8f + magnitude * 0.2f;
191 magnitude = fftSmooth[band];
192
193 // Apply gain
194 magnitude *= audioGain.value() * autoGainValue;
195 magnitude = fl::clamp(magnitude, 0.0f, 1.0f);
196
197 int barHeight = magnitude * HEIGHT;
198 int xStart = band * barWidth;
199
200 for (int x = 0; x < barWidth - 1; x++) {
201 for (int y = 0; y < barHeight; y++) {
202 uint8_t colorIndex = fl::map_range<float, uint8_t>(
203 float(y) / HEIGHT, 0, 1, 0, 255
204 );
205 CRGB color = ColorFromPalette(palette, colorIndex + hue);
206
207 int ledIndex = xyMap(xStart + x, y);
208 if (ledIndex >= 0 && ledIndex < NUM_LEDS) {
209 leds[ledIndex] = color;
210 }
211
212 if (mirrorMode) {
213 int mirrorIndex = xyMap(WIDTH - 1 - (xStart + x), y);
214 if (mirrorIndex >= 0 && mirrorIndex < NUM_LEDS) {
215 leds[mirrorIndex] = color;
216 }
217 }
218 }
219 }
220 }
221}
222
223// Visualization: Radial Spectrum
224void drawRadialSpectrum(FFTBins* fft, float /* peak */) {
225 clearDisplay();
226 CRGBPalette16 palette = getCurrentPalette();
227
228 int centerX = WIDTH / 2;
229 int centerY = HEIGHT / 2;
230
231 for (size_t angle = 0; angle < 360; angle += 6) { // Reduced resolution
232 size_t band = (angle / 6) % NUM_BANDS;
233 if (band >= fft->bins_db.size()) continue;
234
235 float magnitude = fft->bins_db[band] / 100.0f;
236 magnitude = MAX(0.0f, magnitude - noiseFloor.value());
237 magnitude *= audioGain.value() * autoGainValue;
238 magnitude = fl::clamp(magnitude, 0.0f, 1.0f);
239
240 int radius = magnitude * (MIN(WIDTH, HEIGHT) / 2);
241
242 for (int r = 0; r < radius; r++) {
243 int x = centerX + (r * cosf(angle * PI / 180.0f));
244 int y = centerY + (r * sinf(angle * PI / 180.0f));
245
246 if (x >= 0 && x < WIDTH && y >= 0 && y < HEIGHT) {
247 uint8_t colorIndex = fl::map_range<int, uint8_t>(r, 0, radius, 255, 0);
248 int ledIndex = xyMap(x, y);
249 if (ledIndex >= 0 && ledIndex < NUM_LEDS) {
250 leds[ledIndex] = ColorFromPalette(palette, colorIndex + hue);
251 }
252 }
253 }
254 }
255}
256
257// Visualization: Logarithmic Waveform (prevents saturation)
258void drawWaveform(const Slice<const int16_t>& pcm, float /* peak */) {
259 clearDisplay();
260 CRGBPalette16 palette = getCurrentPalette();
261
262 int samplesPerPixel = pcm.size() / WIDTH;
263 int centerY = HEIGHT / 2;
264
265 for (size_t x = 0; x < WIDTH; x++) {
266 size_t sampleIndex = x * samplesPerPixel;
267 if (sampleIndex >= pcm.size()) break;
268
269 // Get the raw sample value
270 float sample = float(pcm[sampleIndex]) / 32768.0f; // Normalize to -1.0 to 1.0
271
272 // Apply logarithmic scaling to prevent saturation
273 float absSample = fabsf(sample);
274 float logAmplitude = 0.0f;
275
276 if (absSample > 0.001f) { // Avoid log(0)
277 // Logarithmic compression: log10(1 + gain * sample)
278 float scaledSample = absSample * audioGain.value() * autoGainValue;
279 logAmplitude = log10f(1.0f + scaledSample * 9.0f) / log10f(10.0f); // Normalize to 0-1
280 }
281
282 // Apply smooth sensitivity curve
283 logAmplitude = powf(logAmplitude, 0.7f); // Gamma correction for better visual response
284
285 // Calculate amplitude in pixels
286 int amplitude = int(logAmplitude * (HEIGHT / 2));
287 amplitude = fl::clamp(amplitude, 0, HEIGHT / 2);
288
289 // Preserve the sign for proper waveform display
290 if (sample < 0) amplitude = -amplitude;
291
292 // Color mapping based on amplitude intensity
293 uint8_t colorIndex = fl::map_range<int, uint8_t>(abs(amplitude), 0, HEIGHT/2, 40, 255);
294 CRGB color = ColorFromPalette(palette, colorIndex + hue);
295
296 // Apply brightness scaling for low amplitudes
297 if (abs(amplitude) < HEIGHT / 4) {
298 color.fadeToBlackBy(128 - (abs(amplitude) * 512 / HEIGHT));
299 }
300
301 // Draw vertical line from center
302 if (amplitude == 0) {
303 // Draw center point for zero amplitude
304 int ledIndex = xyMap(x, centerY);
305 if (ledIndex >= 0 && ledIndex < NUM_LEDS) {
306 leds[ledIndex] = color.fadeToBlackBy(200);
307 }
308 } else {
309 // Draw line from center to amplitude
310 int startY = (amplitude > 0) ? centerY : centerY + amplitude;
311 int endY = (amplitude > 0) ? centerY + amplitude : centerY;
312
313 for (int y = startY; y <= endY; y++) {
314 if (y >= 0 && y < HEIGHT) {
315 int ledIndex = xyMap(x, y);
316 if (ledIndex >= 0 && ledIndex < NUM_LEDS) {
317 // Fade edges for smoother appearance
318 CRGB pixelColor = color;
319 if (y == startY || y == endY) {
320 pixelColor.fadeToBlackBy(100);
321 }
322 leds[ledIndex] = pixelColor;
323 }
324 }
325 }
326 }
327 }
328}
329
330// Visualization: VU Meter
331void drawVUMeter(float rms, float peak) {
332 clearDisplay();
333 CRGBPalette16 palette = getCurrentPalette();
334
335 // RMS level bar
336 int rmsWidth = rms * WIDTH * audioGain.value() * autoGainValue;
337 rmsWidth = MIN(rmsWidth, WIDTH);
338
339 for (int x = 0; x < rmsWidth; x++) {
340 for (int y = HEIGHT/3; y < 2*HEIGHT/3; y++) {
341 uint8_t colorIndex = fl::map_range<int, uint8_t>(x, 0, WIDTH, 0, 255);
342 int ledIndex = xyMap(x, y);
343 if (ledIndex >= 0 && ledIndex < NUM_LEDS) {
344 leds[ledIndex] = ColorFromPalette(palette, colorIndex);
345 }
346 }
347 }
348
349 // Peak indicator
350 int peakX = peak * WIDTH * audioGain.value() * autoGainValue;
351 peakX = MIN(peakX, WIDTH - 1);
352
353 for (int y = HEIGHT/4; y < 3*HEIGHT/4; y++) {
354 int ledIndex = xyMap(peakX, y);
355 if (ledIndex >= 0 && ledIndex < NUM_LEDS) {
356 leds[ledIndex] = CRGB::White;
357 }
358 }
359
360 // Beat indicator
361 if (isBeat && beatFlash) {
362 for (int x = 0; x < WIDTH; x++) {
363 int ledIndex1 = xyMap(x, 0);
364 int ledIndex2 = xyMap(x, HEIGHT - 1);
365 if (ledIndex1 >= 0 && ledIndex1 < NUM_LEDS) leds[ledIndex1] = CRGB::White;
366 if (ledIndex2 >= 0 && ledIndex2 < NUM_LEDS) leds[ledIndex2] = CRGB::White;
367 }
368 }
369}
370
371// Visualization: Matrix Rain
372void drawMatrixRain(float peak) {
373 // Shift everything down
374 for (int x = 0; x < WIDTH; x++) {
375 for (int y = HEIGHT - 1; y > 0; y--) {
376 int currentIndex = xyMap(x, y);
377 int aboveIndex = xyMap(x, y - 1);
378 if (currentIndex >= 0 && currentIndex < NUM_LEDS &&
379 aboveIndex >= 0 && aboveIndex < NUM_LEDS) {
380 leds[currentIndex] = leds[aboveIndex];
381 leds[currentIndex].fadeToBlackBy(40);
382 }
383 }
384 }
385
386 // Add new drops based on audio
387 int numDrops = peak * WIDTH * audioGain.value() * autoGainValue;
388 for (int i = 0; i < numDrops; i++) {
389 int x = random(WIDTH);
390 int ledIndex = xyMap(x, 0);
391 if (ledIndex >= 0 && ledIndex < NUM_LEDS) {
392 leds[ledIndex] = CHSV(96, 255, 255); // Green
393 }
394 }
395}
396
397// Visualization: Fire Effect (simplified for WebAssembly)
398void drawFireEffect(float peak) {
399 // Simple fire effect without buffer
400 clearDisplay();
401
402 // Add heat at bottom based on audio
403 int heat = 100 + (peak * 155 * audioGain.value() * autoGainValue);
404 heat = MIN(heat, 255);
405
406 for (int x = 0; x < WIDTH; x++) {
407 for (int y = 0; y < HEIGHT; y++) {
408 // Simple gradient from bottom to top
409 int heatLevel = heat * (HEIGHT - y) / HEIGHT;
410 heatLevel = heatLevel * random(80, 120) / 100; // Add randomness
411 heatLevel = MIN(heatLevel, 255);
412
413 int ledIndex = xyMap(x, y);
414 if (ledIndex >= 0 && ledIndex < NUM_LEDS) {
415 leds[ledIndex] = HeatColor(heatLevel);
416 }
417 }
418 }
419}
420
421// Visualization: Plasma Wave
422void drawPlasmaWave(float peak) {
423 static float time = 0;
424 time += 0.05f + (peak * 0.2f);
425
426 CRGBPalette16 palette = getCurrentPalette();
427
428 for (int x = 0; x < WIDTH; x++) {
429 for (int y = 0; y < HEIGHT; y++) {
430 float value = sinf(x * 0.1f + time) +
431 sinf(y * 0.1f - time) +
432 sinf((x + y) * 0.1f + time) +
433 sinf(sqrtf(x * x + y * y) * 0.1f - time);
434
435 value = (value + 4) / 8; // Normalize to 0-1
436 value *= audioGain.value() * autoGainValue;
437
438 uint8_t colorIndex = value * 255;
439 int ledIndex = xyMap(x, y);
440 if (ledIndex >= 0 && ledIndex < NUM_LEDS) {
441 leds[ledIndex] = ColorFromPalette(palette, colorIndex + hue);
442 }
443 }
444 }
445}
446
447void setup() {
448 Serial.begin(115200);
449 delay(1000);
450
451 Serial.println("Audio Reactive Visualizations");
452 Serial.println("Initializing...");
453 Serial.print("Display size: ");
454 Serial.print(WIDTH);
455 Serial.print("x");
456 Serial.println(HEIGHT);
457
458 // Initialize LEDs
460 FastLED.setBrightness(brightness.as_int());
461 FastLED.clear();
462 FastLED.show();
463
464 // Set up UI callbacks
465 brightness.onChanged([](float value) {
466 FastLED.setBrightness(value);
467 });
468
469 Serial.println("Setup complete!");
470}
471
472void loop() {
473 // Check if audio is enabled
474 if (!enableAudio) {
475 // Show a simple test pattern
477 FastLED.show();
478 delay(20);
479 return;
480 }
481
482 // Process only one audio sample per frame to avoid accumulation
483 AudioSample sample = audio.next();
484 if (sample.isValid()) {
485 // Update sound meter
486 soundMeter.processBlock(sample.pcm());
487
488 // Get audio levels
489 float rms = sample.rms() / 32768.0f;
490
491 // Calculate peak
492 int32_t maxSample = 0;
493 for (size_t i = 0; i < sample.pcm().size(); i++) {
494 int32_t absSample = fabsf(sample.pcm()[i]);
495 if (absSample > maxSample) {
496 maxSample = absSample;
497 }
498 }
499 float peak = float(maxSample) / 32768.0f;
500 peakLevel = peakLevel * 0.9f + peak * 0.1f; // Smooth peak
501
502 // Update auto gain
504
505 // Beat detection
506 if (beatDetect) {
507 isBeat = detectBeat(peak);
508 }
509
510 // Get FFT data - create local FFTBins to avoid accumulation
511 FFTBins fftBins(NUM_BANDS);
512 sample.fft(&fftBins);
513
514 // Update color animation
515 hue += 1;
516
517 // Apply beat flash
518 if (isBeat && beatFlash) {
519 for (int i = 0; i < NUM_LEDS; i++) {
520 leds[i].fadeLightBy(-50); // Make brighter
521 }
522 }
523
524 // Draw selected visualization
525 switch (visualMode.as_int()) {
526 case 0: // Spectrum Bars
527 drawSpectrumBars(&fftBins, peakLevel);
528 break;
529
530 case 1: // Radial Spectrum
531 drawRadialSpectrum(&fftBins, peakLevel);
532 break;
533
534 case 2: // Waveform
535 drawWaveform(sample.pcm(), peakLevel);
536 break;
537
538 case 3: // VU Meter
540 break;
541
542 case 4: // Matrix Rain
544 break;
545
546 case 5: // Fire Effect
548 break;
549
550 case 6: // Plasma Wave
552 break;
553 }
554 }
555
556 FastLED.show();
557
558 // Add a small delay to prevent tight loops in WebAssembly
559 #ifdef __EMSCRIPTEN__
560 delay(1);
561 #endif
562}
563
CRGB leds[NUM_LEDS]
#define NUM_LEDS
uint8_t hue
int y
Definition simple.h:93
float rms(Slice< const int16_t > data)
Definition simple.h:98
int x
Definition simple.h:92
fl::XYMap xyMap
Definition ColorBoost.h:61
FL_DISABLE_WARNING_PUSH FL_DISABLE_WARNING_GLOBAL_CONSTRUCTORS CFastLED FastLED
Global LED strip management instance.
Definition FastLED.cpp:74
central include file for FastLED, defines the CFastLED class/object
uint8_t heat[NUM_LEDS]
Definition Fire2023.h:101
UINumberField palette("Palette", 0, 0, 2)
AudioAnalyzeFFT1024 fft
#define COLOR_ORDER
Definition advanced.h:42
UISlider beatSensitivity("Beat Sensitivity", 1.5f, 0.5f, 3.0f, 0.1f)
uint32_t lastBeatTime
Definition advanced.h:89
UICheckbox beatFlash("Beat Flash", true)
void drawMatrixRain(float peak)
Definition advanced.h:372
SoundLevelMeter soundMeter(0.0, 0.0)
bool detectBeat(float energy)
Definition advanced.h:117
void drawRadialSpectrum(FFTBins *fft, float)
Definition advanced.h:224
bool isBeat
Definition advanced.h:90
#define WIDTH
Definition advanced.h:36
#define LED_TYPE
Definition advanced.h:41
static const int NUM_BANDS
Definition advanced.h:83
float fftSmooth[NUM_BANDS]
Definition advanced.h:84
void drawVUMeter(float rms, float peak)
Definition advanced.h:331
UISlider fadeSpeed("Fade Speed", 20, 0, 255, 1)
UITitle title("Audio Reactive Visualizations")
void setup()
Definition advanced.h:447
UIDescription description("Real-time audio visualizations with beat detection and multiple modes")
uint8_t fireBuffer[WIDTH][HEIGHT]
Definition advanced.h:99
void drawFireEffect(float peak)
Definition advanced.h:398
void updateAutoGain(float level)
Definition advanced.h:148
float peakLevel
Definition advanced.h:92
void drawWaveform(const Slice< const int16_t > &pcm, float)
Definition advanced.h:258
UISlider noiseFloor("Noise Floor", 0.1f, 0.0f, 1.0f, 0.01f)
void drawSpectrumBars(FFTBins *fft, float)
Definition advanced.h:176
float beatAverage
Definition advanced.h:87
UIDropdown visualMode("Visualization Mode", {"Spectrum Bars", "Radial Spectrum", "Waveform", "VU Meter", "Matrix Rain", "Fire Effect", "Plasma Wave"})
UICheckbox mirrorMode("Mirror Mode", false)
UISlider brightness("Brightness", 128, 0, 255, 1)
float beatVariance
Definition advanced.h:88
#define LED_PIN
Definition advanced.h:40
float autoGainValue
Definition advanced.h:91
UISlider audioGain("Audio Gain", 1.0f, 0.1f, 5.0f, 0.1f)
CRGBPalette16 getCurrentPalette()
Definition advanced.h:103
int beatHistoryIndex
Definition advanced.h:86
UIAudio audio("Audio Input")
float beatHistory[20]
Definition advanced.h:85
UICheckbox beatDetect("Beat Detection", true)
UICheckbox autoGain("Auto Gain", true)
#define HEIGHT
Definition advanced.h:37
float plasma[WIDTH][HEIGHT]
Definition advanced.h:98
void drawPlasmaWave(float peak)
Definition advanced.h:422
UICheckbox enableAudio("Enable Audio", true)
UIDropdown colorPalette("Color Palette", {"Rainbow", "Heat", "Ocean", "Forest", "Party", "Lava", "Cloud"})
void clearDisplay()
Definition advanced.h:167
void loop()
Definition advanced.h:472
const VectorPCM & pcm() const
Definition audio.cpp:17
bool isValid() const
Definition audio.h:29
void fft(FFTBins *out) const
Definition audio.cpp:128
float rms() const
Definition audio.cpp:83
fl::size size() const
Definition slice.h:142
void fadeToBlackBy(CRGB *leds, fl::u16 num_leds, fl::u8 fadeBy)
CRGB ColorFromPalette(const CRGBPalette16 &pal, fl::u8 index, fl::u8 brightness, TBlendType blendType)
void fill_rainbow(struct CRGB *targetArray, int numToFill, fl::u8 initialhue, fl::u8 deltahue=5)
Fill a range of LEDs with a rainbow of colors.
Definition fill.cpp:29
CRGB HeatColor(fl::u8 temperature)
void fill_solid(struct CRGB *targetArray, int numToFill, const struct CRGB &color)
Fill a range of LEDs with a solid color.
Definition fill.cpp:9
#define FL_DISABLE_WARNING(warning)
#define FL_DISABLE_WARNING_PUSH
#define FL_DISABLE_WARNING_POP
const TProgmemRGBPalette16 OceanColors_p
Ocean colors, blues and whites.
const TProgmemRGBPalette16 CloudColors_p
Cloudy color palette.
const TProgmemRGBPalette16 HeatColors_p
Approximate "black body radiation" palette, akin to the FastLED HeatColor() function.
const TProgmemRGBPalette16 ForestColors_p
Forest colors, greens.
const TProgmemRGBPalette16 LavaColors_p
Lava color palette.
const TProgmemRGBPalette16 PartyColors_p
HSV color ramp: blue, purple, pink, red, orange, yellow (and back).
const TProgmemRGBPalette16 RainbowColors_p
HSV Rainbow.
#define MIN(a, b)
Definition math_macros.h:41
#define PI
Definition math_macros.h:89
#define MAX(a, b)
Definition math_macros.h:37
FASTLED_FORCE_INLINE T clamp(T value, T min, T max)
Definition clamp.h:10
fl::u32 time()
Universal millisecond timer - returns milliseconds since system startup.
Definition time.cpp:136
IMPORTANT!
Definition crgb.h:20
CRGB & fadeToBlackBy(fl::u8 fadefactor)
fadeToBlackBy is a synonym for nscale8(), as a fade instead of a scale
@ White
<div style='background:#FFFFFF;width:4em;height:4em;'></div>
Definition crgb.h:703
@ Black
<div style='background:#000000;width:4em;height:4em;'></div>
Definition crgb.h:567
Representation of an RGB pixel (Red, Green, Blue)
Definition crgb.h:86
Representation of an HSV pixel (hue, saturation, value (aka brightness)).
Definition hsv.h:15