How to make animation on LED...

thatoneguy

Joined Feb 19, 2009
6,359
Can you indent your code (Translate tabs to spaces), and most importantly, add comments so the purpose of variables and actions is more clear?
 

nsaspook

Joined Aug 27, 2009
13,315
But how to get animation of jumping/rotating letter from video like that?
There are a few ways to do it. I have a PIC demo board that uses the old school way of geometric transformations to drawing dots on a LED matrix. It uses two 8 bit ports on a PIC to select the row and column of the LEDS. (the wire coils are connected to the CTMU input for a switch function) I know it's not what you want to do but it shows the basic concept of pixel/image rotation using trig functions.

http://www.flickr.com//photos/nsaspook/sets/72157633053457639/show/
http://homepages.inf.ed.ac.uk/rbf/HIPR2/affine.htm
http://homepages.inf.ed.ac.uk/rbf/HIPR2/rotate.htm
https://github.com/nsaspook/matrix_led
 
Last edited:

Thread Starter

RRITESH KAKKAR

Joined Jun 29, 2010
2,829
Ok, I want your help....
This code is for filling ram i.e. for buffer string of char........
you can see the number of char and filling memory are same i want to update the code for variable string to fill memory...
for eg: it just not depend on string char may be 5 or 10 or even 52 like that..
Rich (BB code):
 display("Test         "); //message to be display are saved in ram in form of dots this is done with the help of function and pointers

Rich (BB code):
 display(char *str)   //display is called due to which the char/str point the ascii number of char
{

int addr;                                                      
int z;
while(*str!=0)// the last element of array is null to neglect it this is added
{
 addr = ((int)*str++ - 0x20); // the addr is found from external variable declared in code where all hex value of font are saved then the char ascii value is subtracted from 0x20 and str is incremented for next char value ascii
addr *= 5;// then the addr is multiplied with 5 to get the hex patter of the font i.e. 5x7 stand font
int y=0;
for(z=0;z<5;z++){
        leds[z] = Font2[addr+y];// then this font is saved in leds buffer array with loop
y++;
}
addr = ((int)*str++ - 0x20); // this all do the same with next char 
addr *= 5;
int y=0;
for(z=6;z<11;z++){
leds[z] = Font2[addr+y];
y++;
}
addr = ((int)*str++ - 0x20); 
addr *= 5;
int y=0;
for(z=12;z<17;z++){
leds[z] = Font2[addr+y];
y++;
}
addr = ((int)*str++ - 0x20); 
addr *= 5;
int y=0;
for(z=18;z<23;z++){
leds[z] = Font2[addr+y];
y++;
}
addr = ((int)*str++ - 0x20); 
addr *= 5;
int y=0;
for(z=24;z<29;z++){
leds[z] = Font2[addr+y];
y++;
}
addr = ((int)*str++ - 0x20); 
addr *= 5;
int y=0;
for(z=30;z<35;z++){
leds[z] = Font2[addr+y];
y++;
}
addr = ((int)*str++ - 0x20); 
addr *= 5;
int y=0;
for(z=36;z<41;z++){
leds[z] = Font2[addr+y];
y++;
}
addr = ((int)*str++ - 0x20); 
addr *= 5;
int y=0;
for(z=42;z<47;z++){
leds[z] = Font2[addr+y];
y++;
}

addr = ((int)*str++ - 0x20); 
addr *= 5;
int y=0;
for(z=48;z<53;z++){
leds[z] = Font2[addr+y];
y++;
}
addr = ((int)*str++ - 0x20); 
addr *= 5;
int y=0;
for(z=54;z<59;z++){
leds[z] = Font2[addr+y];
y++;
}
addr = ((int)*str++ - 0x20); 
addr *= 5;
int y=0;
for(z=60;z<65;z++){
leds[z] = Font2[addr+y];
y++;
}

addr = ((int)*str++ - 0x20); 
addr *= 5;
int y=0;
for(z=65;z<70;z++){
leds[z] = Font2[addr+y];
y++;
}
addr = ((int)*str++ - 0x20); 
addr *= 5;
int y=0;
for(z=71;z<76;z++){
leds[z] = Font2[addr+y];
y++;
}








}
}
 

thatoneguy

Joined Feb 19, 2009
6,359
Try LCDAssistant

Which converts one frame a time to hex, decimal, binary, in either vertical order (top to bottom, then right one pixel, top to bottom), or horizontal order (the way we read, left to right, next line left to right, etc).
 

thatoneguy

Joined Feb 19, 2009
6,359
Look at the commands

memset() to reset a buffer to all one character, such as NUL
strcpy() (and friends strncpy, strlcpy, etc)
memmove()

research those, see which your compiler supports, and it will save you a lot of loops.
 
Top