And I'm done! more or less ![]()
I wrote simplified code (as my C++ knowledge is poor), but it works with my setup of 2 matrix displays!
As I was trying to adopt other people's code (Riva yours is brilliant, but didn't work in my hardware arrangement) I realized that I wired my matrices different from most setups. Pins go in one long row (i.e. Pin 12 of matrix 1 is next to Pin 1 of matrix 2), and I actually think this setup easier to wire on breadboards (probably the only way to wire on breadboard) so I'm at loss to understand why mine don't work the same, maybe I wired it different (after all I had to figure out pinouts becuase I had no datasheet, and these are not the same as more popular Sure's displays).
Anyway it doesn't matter, as I figured out code and algorithm of animation. Writing code from scratch is a great educational experience, but it took me almost a week ![]()
It currently works great with 2 devices, but I'm not sure how much modification will be needed to support 3 or more, I will try to enhance it later to see if I can make it universal for any number of displays.
Here's my algorithm:
Legend:
B1 bufer 1
B2 bufer 2
NextChar = Font of next character
1. Fill Buffer B1
2. Begin Loop . If Looped for 8 times, go to 11
3. Display B1
4. Display B2 (it's empty 1st time)
5. Rotate B1: B1[7]=B1[6], B1[6]=B1[5]...B1[1]=B1[0], B1[0]=NextChar[7]
6. Rotate B2: B2[7]=B2[6], B2[6]=B2[5]...B2[1]=B2[0], B2[0]=B1[7]
7. Display B1
8. Display B2
9. Delay (animation delay)
10. Go To 2 (End Loop)
11. Go to 1
I'm also attaching code (it has font file as well in the rar archive), feel free to use and modify it.
I know font is crappy, I had to do everything from scratch because my characters are rotated 90CCW. Pial's web based 8x8 matrix font generator helped a lot! I will draw a prettier font in the future
I would use other's people nice fonts, if someone can suggest how I can rotate them 90 CCW.
I'm also attaching image that shows how animation works in my code.
Bratan_LED_ScrollTest_version1.rar (3.11 KB)
