r/FastLED • • Nov 21 '23

Discussion FastLED with native support for subpixel positioning

​Hi,

I have been experimenting a bit with subpixel positioning on my Teensy 4.1 with a 64x64 led matrix after being inspired by this code by sutaburosu.
https://www.reddit.com/r/FastLED/comments/h7s96r/subpixel_positioning_wu_pixels/

So far I have only used it for some effects in particular and it works realy well. It gives a very nice smooth transition effect.

It would have been nice if this was natively supported by the FastLED library where you for instance could set the size of the "virtual" resolution as a parameter in the library so that the resolution that you work with in the code is higher in general.

So if I have a 64x64 LED Matrix I can configure the virtual resolution to be 10 times larger so that the virtual drawing area is 640x640.

By doing that you get 10 fractions between each pixel.

Are there any similar solutions already existing? Is there anything that prevents this from being made, some difficulties that I haven't thought about?

9 Upvotes

11 comments sorted by

View all comments

0

u/[deleted] Nov 22 '23

[deleted] — view deleted comment

2

u/obidavis Nov 22 '23

Everything I've done in my work is entirely user responsive. However, even in this context there's rarely ever any need to do things entirely on the chip. I typically route things via a proper computer to do actual interesting physics based visuals, and just use the microcontrollers to do 'smart' interpretation of whatever comes out of the computer (interpolation, upsampling, kinda a la fadecandy).

The only real use case I had for doing everything on chip was for an installation running on batteries, although I do find it more fun the more I can do on chip.

1

u/RubiCubix Nov 22 '23

In your case, do you still have the basic handling of the visuals on the chip but they depend on input from the PC in terms of results from the math operations?

As I understand you don't stream the complete "Frame-Buffer" so to speak?

2

u/obidavis Nov 22 '23

Yes that's correct, I avoid sending the whole framebuffer.

What I actually send has been different in all applications though! It might be that I send a 'base' colour and the chip is responsible for altering/augmenting this based on sensor data, or I send some struct with basic shape data and the chip is responsible for constructing the whole buffer out of that.

1

u/RubiCubix Nov 22 '23

I am developing a game using a large LED Matrix with interaction support. Both sensor data and the LED's are handled by one single Teensy 4.1 controller. So in my case there are a lot of interaction and the visuals are changed both based on time lapsed and on user interaction. Using one single Teensy controller for this makes the game very responsive. It's also very convenient to have this running completely standalone without the need of any other hardware.

I guess I could use something like movie2serial by PaulStoffregen to "stream" graphics from a PC but then I would still need to handle the sensor data. I use one single Raspberry PI together with the Teensy 4.1 at the moment and I want to avoid being required to use a more powerful PC.

And I also do feel the same as /u/obidavis, it's fun to see what the chip can perform. =)

2

u/obidavis Nov 22 '23

Entirely agree on the responsiveness point here also. As I've moved more processing to the chip, the visual quality has gone up along with development time!