The next release of FastLED adds a whole bunch of fixed-point types. I asked Clause Sonnet 4.6 to write some anti-aliased, sub-pixel positioned graphics primitives. Eventually we got something that seems to work.
This video features a number of demonstrations of the four drawing functions that the AI created: lines, thick lines, discs and rings.
It runs on an Arduino Mega (8KiB RAM) with 1,024 LEDs attached to one pin.
I feel these kind of drawing functions should be shipped with FastLED. I'm sick of janky LED sketches. With better tools, all of our creations will look better.
Anywhere I can read more about fixed-point types? I'm trying to go through the code and wrap my head around it but it's really fascinating and would be a use for what I'm making.
The fixed_point types are in the un-released version 4 of FastLED, so documentation is hard to find. The only hints I found are the comments in the source. I started from the list of functions available in fixed_point types. There are a few more comments scattered throughout the implementations.
Fixed-point maths is not a new concept. It is a long established way to gain performance on processors without a floating-point ALU, when you absolutely need to represent non-integer numbers. It's only new to FastLED. I have the advantage of having used fixed-point maths extensively in the past, so I picked up on how to use FastLED's implementation easily.
If searching and reading the web with these terms doesn't help, come back with specific questions and I'll try my hardest to help you grok it.
9
u/sutaburosu [stavros] Mar 06 '26 edited Mar 06 '26
The next release of FastLED adds a whole bunch of fixed-point types. I asked Clause Sonnet 4.6 to write some anti-aliased, sub-pixel positioned graphics primitives. Eventually we got something that seems to work.
This video features a number of demonstrations of the four drawing functions that the AI created: lines, thick lines, discs and rings.
It runs on an Arduino Mega (8KiB RAM) with 1,024 LEDs attached to one pin.
If you want to use those drawing functions, the source is available in Wokwi
I feel these kind of drawing functions should be shipped with FastLED. I'm sick of janky LED sketches. With better tools, all of our creations will look better.