Teensy + WS2812b + Animated GIF

Status
Not open for further replies.

Jerware

Well-known member
Has anyone written a Teensy library to display animated GIFs on WS2812B LEDs? I know the MEU guys recently posted a tool that converts GIFs to arduino code, but I'm looking for a post-compile solution that reads animated GIFs from SD. There's also the pixelmatrix/SmartMatrix library that incorporates the excellent GIF interpreter code by Craig A. Lindley, but it uses the common 32x32 matrix boards (not WS2812).

If this hasn't been written yet, how difficult would it be to branch/port the pixelmatrix library? I spent the evening looking at it, and as usual I feel over my head. I'd appreciate expert opinions.

https://github.com/pixelmatix/AnimatedGIFs
 
Yes, that's a cool hack but not what I'm looking for. I suppose it's just a matter of time before someone ports the existing Teensy/SdFat animated GIF code to WS2812B. I would really look forward to this.
 
Hi Jeremy, here's the line of code that draws a pixel to the background buffer:
https://github.com/pixelmatix/AnimatedGIFs/blob/master/LZWFunctions.cpp#L260

And this line of code swaps buffers, drawing the background buffer to the display:
https://github.com/pixelmatix/AnimatedGIFs/blob/master/LZWFunctions.cpp#L267

I assume there are equivalent functions as part of the WS2811 library. Craig's AnimatedGIFs code is hard coded for a 32x32 pixel GIF, but you could always ignore some pixels if you want to draw to a smaller size array.

- Louis
 
I'm refactoring AnimatedGIFs, trying to make it more generic. Right now I've pulled out all the SmartMatrix Library code from the GIF decoder and use generic callback functions instead. I pushed my changes to GitHub.
 
I'm refactoring AnimatedGIFs, trying to make it more generic. Right now I've pulled out all the SmartMatrix Library code from the GIF decoder and use generic callback functions instead. I pushed my changes to GitHub.

Interesting! If you ever have time, I would deeply appreciate an example .INO that demonstrates how to incorporate the callbacks into the NeoPixel/NeoMatrix libraries.
 
Status
Not open for further replies.
Back
Top