Go Down

Topic: Best way to code animations on 8x32 led matrix?? (Read 2613 times) previous topic - next topic

raaymaan

Hi guys, first post here, can't wait to be more involved in this great community!!

Ok, I don't have a specific problem as such, just looking for guidance/advice.

I'm in the process of building an LED matrix, 8x32, with 4 MAX7221/7219s. I know I want the display to show various animations, some containing text characters, others just nice visual patterns, but before I jump straight in (I'm not the most experienced coder...) I'd like a rough plan of how to go about it.

Would it best to 'hard code' some animations, for example by setting individual LEDs, rows, columns etc, or is it better to utilise a 'library' as such, like a header file with the animation coded, then increment it along the display in the main loop? Forgive me if I'm not making myself very clear, I'd be happy to elaborate!

Any feedback whatsoever would be greatly appreciated!

scswift

It really depends on what you want to do and how complex you want the animations to be.  It would also help to know if you plan on simply turning LEDs on and off, or if you intend to adjust the brightness of them.

If you store the animations, you can store whatever you want, but you're limited by the ram available.  If you're only turning LEDs on and off though, you can store each frame of animation in just 32 bytes... one bit per LED.

If you only want to store static images, and then animate those in motion... like, say, the shape of individual letters which you then scroll across the display, you're less limited by ram.

You will probably use more ram if you algorithmically generate static images than if you store the data in bits/bytes and have one function to display that, so there's no advantage there, but if you need animated images, like say, a spinning line which takes up the whole display, then algorithmically generating it might be the way to go.

Similarly, if you need to "wipe" or "dissolve" the characters on/off the display, using an algorithm to do that to static images would be the way to go, rather than making an animation of the letter being wiped/dissolved.

raaymaan

Thanks for the quick response.

I don't intend on having them too complex, mostly they'll be recurring text, no more that 20 characters I would've thought. The brightness of the LEDs will be uniformly controlled by hardware, I don't require PWM to 'shade' certain patterns or anything.

So I guess I'll get started with pen and paper to find the best LED combinations to draw text characters, then take it from there once I become more familiarised.

Thanks scswift  :)

Go Up