Releases Β· FastLED/FastLED
3.10.1 - Bug Fix for 3.10.0#include "FastLED.h"
fixedFull Changelog: 3.9.20...3.10.0
3.9.20: Misc FixesOptional upgrade. Fixes fadeByLight not being in the global namespace. This fixes a regression that happened in 3.9.17.
Full Changelog: 3.9.19...3.9.20
Hot Fix #2 for 3.9.17For more information see this bug fix thread.
It turns out the older AVR gcc compilers will not eliminate complex static objects that are not referenced. However it seems it will eliminate them if they are in statics inside static functions, like this:
This will unconditionally initialize in avr-gcc at startup, but be removed in more modern toolchains.
typedef fl::hash_map<Key, Value> HashMap;
static HashMap gStatic;
This however, will be removed in avr-gcc and others
static HashMap& get_static() {
static HashMap s_static;
return s_static;
}
Here is a Chat GPT Summary:
π Summary:AVR-GCC does not aggressively eliminate unused static non-POD objects β even if they appear to be unused β because:
.ctors
section to ensure initialization of static objects with constructors..ctors
and the linker keeps them.Modern Clang and GCC (non-AVR) will remove these if they are not referenced and the constructors are not marked in a way that ensures their side effects are preserved.
In the Arduino build system (typically using avr-gcc
):
.ctors
section which the startup code walks through during initialization.-flto
), you may start seeing more Clang/GCC-like elision behavior if you're not careful.libc
(avr-libc
) startup code explicitly calls global/static constructors via __do_global_ctors
..ctors
section using .section .ctors
+ .initN
priorities.In more aggressive modern toolchains (Clang/GCC with LTO):
__attribute__((used))
or volatile
globals if you want to force retention.__attribute__((constructor))
for function-level hooks that are less likely to be optimized out.struct AutoRun { AutoRun() { Serial.println("I ran!"); } }; static AutoRun my_auto_run; // Kept by AVR-GCC, likely dropped by Clang w/LTO
To preserve it in Clang:
__attribute__((used)) static AutoRun my_auto_run;β Conclusion
This is an AVR-GCC behavior, not strictly Arduino's doing β but Arduino's default settings do reinforce this behavior by avoiding LTO and preserving .ctors
invocations. Modern toolchains need extra care to keep static initializers with side effects.
This release has a few bug fixes in it and some internal refactorings that has been on my to-do list for a while. The next release will have more features and less core changes.
FastLED now has a small subset of std:: data structures. This allows complex code ingest from open source which rely on things like std::vector<>, hashmaps and others. Unlike other micro stdlib attempts, this one actually compiles everywhere thanks to our ~50 testing configurations that we run on each change committed to the repo.
These std data structures were used to create complex rendering functions xypaths that look absolutely jaw dropping.
However in this release my attention got pulled into about four different directions. Audio and xypaths were added to the core, but the examples were prunned for this release, in order to get this release out in a timely manner.
What's all the noise about lines and rasterization in this release?
You ever try to draw a point or a line on a LED matrix? By default it looks awful. As the point particle moves it lights up one led index at a time. It's tricky to make this transition look smooth. Drawing beautiful lines on matrices requires pixel-neighboring calculations in order to correctly blend into a low resolution strip/matrix. And that's what most of the new math you see below is about.. Take a point in float(x,y) and then color a tile of 2x2 pixels, or 2x1 if you are in a strip.
Happy coding!
Change listThis release is for the artists and makers who want to make the light they want to see in the world.
fastled_3_16_small.mp4FastLED 3.9.16 is now released. Arduino will approve it in the next few hours and should have it available through your IDE by Friday morning.
This release of FastLED is geared toward our programmer-artist community. If you love creating amazing visuals then this release will be one of the most significant releases yet for you. Read on:
Summary of Visual Enhancements in FastLED 3.9.16FxWave: FastLED now features a 1D and 2D wave simulator. Special thanks to Shawn Silverman who provided the differential equations to make this work. This simulator runs in int16_t fixed integer space, allowing it to be fast on MCU's without a dedicated FP processor. We support super scaling the wave simulator which is then down scaled for rendering. The wave simulator will default to half-duplex which means negative values are discarded. This allows the simulator in it's default state to produce black, instead of some midpoint (127) color. The fixed 16 point integer calculation has enough bit depth to run easing functions mapping [0, 1] -> [0, 1] without loss of quality. Unlike particle based effects which slow down as the complexity increases, the WaveSimulator does not suffer from this. The same processing is needed whether the wave simulator is drawing all black or otherwise, so go wild.
Animations: TimeAlpha classes now offer smooth transitions based on the current time and begin & end times. You will trigger the TimeAlpha which will start the clock. After this, you can called the TimeAlpha's update()
function to retrieve the current alpha value. You can use this alpha transition to do path tracing. For example in the video above I'm drawing a cross by running a pixel trace with a span of 6. Any intersection with the wave simulator is then incremented by the specified value. Example usages include: one TimeAlpha class can be used for brightness control while another can be used as input for a parametric path, taking in a uint8_t
or float
and outputting x
and y
.
Alpha-less blending: CRGB::blendAlphaMaxChannel(...) allows per-pixel blending between most visualizers now in the wild. FastLED does not have a strong concept of alpha masks. This really bothered me as compositing is the key for great visualizers and this algorithm produces striking results and can essentially be bolted on without much changes: the brightness of a pixel is a strong signal for proper mixing. You will specify an upper and lower pixel. The upper pixel is queried for the max brightness of it's components. This max brightness then becomes the alpha mask and the two pixels are mixed to generate a new pixel.
fx/fx2d/blend.h
is a new Fx2d
subclass that functions as a blend stack. combining several Fx2d
classes into one functional Fx2d
instance. Each Fx2d
contained in the blending stack can have it's own blur settings specified. The layers are then composited from back to front. The bottom layer is drawn directly without blending. The rest of the channels are composited via CRGB::blendAlphaMaxChannel(...). The bluring parameters for the blend stack can be set for the whole stack, or per frame, allowing striking visual quality even at low resolution and eliminates a lot of aliasing effects common in FastLED visualizers.
inoise(...) just went 4D. This is designed to support irregular shapes like led strip wrapped cylinders, which is the main use case. In this instance you could define a width and radius and then compute each pixel in 3D space. You can then run the x,y,z coordinates through inoise(...) plus a time factor to produce a noise pattern.
FireMatrix and FireCylinder. Fire2012 visualizer is becoming more dated by the day. There are lot of 2D fire simulators in the wild based on FastLED's perlin noise functions. The FireMatrix is a straight matrix for flat pannels, while FireCylinder wrapps around so that the first and last x value are seemless. FireCylinder is perfect for those flex led panels if you want to bend them on themselves - you will now get a full 360 fire effect.
examples/FxWave2d
demo was generated
That's it at a high level. If you aren't interested in the details of this release you can stop reading now.
Release NotesEVERY_N_MILLISECONDS_RANDOM(MIN, MAX)
macro for sketches.CRGB CRGB::blendAlphaMaxChannel(const CRGB& upper, const CRGB& lower)
for fx blending without alpha
.blendAlphaMaxChannel(...)
fl/time_alpha.h
update(...)
will give you the current time progression.uint8_t
from 0 -> 255 representing current animation progression.fonts/
a
into it's font representation and will need to be done ad-hoc style. The API on this is going to change a lot so it's recommended that if you use the fonts that you copy them directly into your sketch. Otherwise it's very likely the API will change in the near future when font mapping is added.Happy coding! ~Zach
New ContributorsFull Changelog: 3.9.15...3.9.16
3.9.15 FastLED 3.9.14 FastLED 3.9.13 - HD 107 "Turbo" 40Mhz LED SupportFull Changelog: 3.9.12...3.9.13
You canβt perform that action at this time.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4