Hi,
last week i bought a minipov3 board...thats working great
then i follwed your GREAT toturial making a 3x3x3 led cube.
IT WORKING GREAT, THANKS for that !!!!
i only have one small question
i downloaded your test software : http://cachefly.oreilly.com/make/LEDcube.zip thats working OK
but now i want to LOOP the "led animation" .
finally i want to make a "sleeping" light for my daugther and thats why it has to LOOP.
the current test file doesn't loop
can someone please give me the code , or explanation HOW TO loop the animation i created ?
many many thanks in advance
MEnno
??? how to LOOP the 3x3x3 animation ???
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
-
- Posts: 4
- Joined: Sun Jan 24, 2010 7:55 am
??? how to LOOP the 3x3x3 animation ???
- Attachments
-
- ledcubetest.c
- this code DOESN'T loop
- (9.15 KiB) Downloaded 379 times
-
- Posts: 12151
- Joined: Thu Apr 06, 2006 4:21 pm
Re: ??? how to LOOP the 3x3x3 animation ???
hi we didnt write the 3x3x3 cube code...so unfortunately we dont know what to suggest can you contact the author of that code?
-
- Posts: 179
- Joined: Sat Nov 28, 2009 5:54 pm
Re: ??? how to LOOP the 3x3x3 animation ???
if you're looking for it to run the internal loop forever then its probably something like :-
caveat, i don't have, or have ever seen a minipov
Code: Select all
for(;;) {
// loop through entire Image Table of Image Elements
// each Image Element consists of a 3 planes of 3x3 LED (each LED on or off) data and a Duration
int j;
j = 0;
do {
displayImage(j);
j++;
} while (pgm_read_byte(&imageTab[j].imageDuration) != 0); // 0 signifies end of table
}
-
- Posts: 4
- Joined: Sun Jan 24, 2010 7:55 am
Re: ??? how to LOOP the 3x3x3 animation ???
thanks
but can you put that in the ledcubetest.c and make 1 new .c file of it ?
sorry but i do not understand were to put this line of code...
thanks in advance
m
but can you put that in the ledcubetest.c and make 1 new .c file of it ?
sorry but i do not understand were to put this line of code...
thanks in advance
m
-
- Posts: 179
- Joined: Sat Nov 28, 2009 5:54 pm
Re: ??? how to LOOP the 3x3x3 animation ???
try this.
- Attachments
-
- ledcubetest.c
- wrapped with infinite for
- (9.18 KiB) Downloaded 393 times
-
- Posts: 4
- Joined: Sun Jan 24, 2010 7:55 am
Re: ??? how to LOOP the 3x3x3 animation ???
MANY THNKS MAN!
i will give it a try....
m
i will give it a try....
m
-
- Posts: 4
- Joined: Sun Jan 24, 2010 7:55 am
Re: ??? how to LOOP the 3x3x3 animation ???
THANKX man
its working GREAT
thankx for aal the support !!!
m
its working GREAT
thankx for aal the support !!!
m
-
- Posts: 179
- Joined: Sat Nov 28, 2009 5:54 pm
Re: ??? how to LOOP the 3x3x3 animation ???
anytime, all i did was basically add an infinite loop around the bit that did all the work,the for(;;) , and make sure the index was set back to zero.
-
- Posts: 19
- Joined: Tue Jun 08, 2010 10:54 am
Re: ??? how to LOOP the 3x3x3 animation ???
I was curious and glanced at this because I am looking into the led cube stuff.
I looked at the original code and if you deleted that last sequence for the leds the origional loop would go forever, and if you wanted it to stop again you just include that line.
For those who care, I suggest trying with the following line deleted for it to loop, hopefully messing with less code this way.
I looked at the original code and if you deleted that last sequence for the leds the origional loop would go forever, and if you wanted it to stop again you just include that line.
For those who care, I suggest trying with the following line deleted for it to loop, hopefully messing with less code this way.
Code: Select all
{ 0b000, 0b000, 0b000, 0b000, 0b000, 0b000, 0b000, 0b000, 0b000, 0 }, // this is a dummy element for end of table (duration=0)
-
- Posts: 1645
- Joined: Sat Nov 10, 2007 12:59 am
Re: ??? how to LOOP the 3x3x3 animation ???
i think that if you delete the 0 duration line in the animation, the code will just start interpretting itself as an animation sequence and run until it happens to a chunk of itself with duration 0.stevenl1 wrote: I looked at the original code and if you deleted that last sequence for the leds the origional loop would go forever, and if you wanted it to stop again you just include that line.
maybe.
-
- Posts: 1645
- Joined: Sat Nov 10, 2007 12:59 am
Re: ??? how to LOOP the 3x3x3 animation ???
ok. looked at the code and now i'm pretty sure.mtbf0 wrote:maybe.
when the code finishes interpreting itself as image data it will probably find some zeroed out code space and stop there.
Please be positive and constructive with your questions and comments.