This sketch mirrors the SD-backed video flow in FASTLED4 and points it at a ledmapper.com-style 32x32 asset at data/video1.rgb.
This sketch mirrors the SD-backed video flow in FASTLED4 and points it at a ledmapper.com-style 32x32 asset at data/video1.rgb.video1.rgb is NOT committed to this repo. It is hosted in FastLED/assets and referenced by the sidecar data/video1.rgb.lnk (fbuild JSON descriptor with url/sha256/size) resolved at build time. See data/readme.txt for the fetch command (fbuild lnk pull).
The preview screen map is loaded from data/screenmap.json, sourced from the ledmapper 32x32 quad serpentine preset, and is kept local because it is small.
#include "FastLED.h"
#ifndef LED_PIN
#define LED_PIN 2
#endif
#ifndef CHIP_SELECT_PIN
#define CHIP_SELECT_PIN 5
#endif
#define LED_TYPE WS2812B
#define COLOR_ORDER GRB
#define MATRIX_WIDTH 32
#define MATRIX_HEIGHT 32
#define NUM_LEDS (MATRIX_WIDTH * MATRIX_HEIGHT)
#define VIDEO_FPS 30
#define VIDEO_FRAME_HISTORY 2
#define DEFAULT_BRIGHTNESS 96
"Streams data/video1.rgb as a 32x32 mapped raw RGB asset. "
"Change VIDEO_FPS if the export was authored at a different frame rate.");
Serial.println(
"FxLedmapper32x32 setup");
Serial.println(
"Failed to initialize file system.");
return;
}
Serial.println(
"Failed to read data/screenmap.json");
return;
}
FL_WARN(
"Failed to open data/video1.rgb");
return;
}
Serial.println(
"FxLedmapper32x32 ready");
}
FL_WARN(
"FxLedmapper32x32 halted due to setup error.");
}
return;
}
}
fl::UIDescription description("Demo of the Animatrix effects. @author of fx is StefanPetrick")
fl::UITitle title("Animartrix")
fl::UISlider brightness("Brightness", BRIGHTNESS, 0, 255)
FL_DISABLE_WARNING_PUSH FL_DISABLE_WARNING_GLOBAL_CONSTRUCTORS CFastLED FastLED
Global LED strip management instance.
fl::Video video(NUM_LEDS, 2.0f)
fl::FileSystem filesystem
#define VIDEO_FRAME_HISTORY
fl::UISlider playbackSpeed("Playback Speed", 1.0f, -2.0f, 2.0f, 0.01f)
#define DEFAULT_BRIGHTNESS
void fill_solid(CRGB *targetArray, int numToFill, const CRGB &color) FL_NO_EXCEPT
Fill a range of LEDs with a solid color.
@ TypicalLEDStrip
Typical values for SMD5050 LEDs.
#define EVERY_N_SECONDS(N)
Checks whether to execute a block of code every N seconds.
fl::u32 millis()
Universal millisecond timer - returns milliseconds since system startup.
@ Black
<div style='background:#000000;width:4em;height:4em;'></div>
Representation of an 8-bit RGB pixel (Red, Green, Blue)
Aggregator header for the fl/ui/ family of per-element UI types.