๐Ÿ“ฃ๐Ÿ“ช ๐Ÿšš Adafruit will not be shipping USPS orders Monday October 14, 2019 ๐Ÿ—“. Expedited USPS orders placed after 11am ET ๐Ÿ•š Friday October 11 will go out Tuesday October 15 ๐Ÿ“ฃ๐Ÿ“ช๐Ÿšš
0

??? how to LOOP the 3x3x3 animation ???
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

??? how to LOOP the 3x3x3 animation ???

by megasound on Sun Jan 24, 2010 8:01 am

Hi,
last week i bought a minipov3 board...thats working great
then i follwed your GREAT toturial making a 3x3x3 led cube. :D
IT WORKING GREAT, THANKS for that !!!! :D

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
Attachments
ledcubetest.c
this code DOESN'T loop
(9.15 KiB) Downloaded 365 times
megasound
 
Posts: 4
Joined: Sun Jan 24, 2010 7:55 am

Re: ??? how to LOOP the 3x3x3 animation ???

by adafruit on Sun Jan 24, 2010 12:54 pm

hi we didnt write the 3x3x3 cube code...so unfortunately we dont know what to suggest :? can you contact the author of that code?

adafruit
 
Posts: 12151
Joined: Thu Apr 06, 2006 4:21 pm
Location: nyc

Re: ??? how to LOOP the 3x3x3 animation ???

by charliex on Sun Jan 24, 2010 2:59 pm

if you're looking for it to run the internal loop forever then its probably something like :-

Code: Select all | TOGGLE FULL SIZE
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
}


caveat, i don't have, or have ever seen a minipov
http://032.la - Null Space Labs.
charliex
 
Posts: 179
Joined: Sat Nov 28, 2009 5:54 pm
Location: Las Vegas

Re: ??? how to LOOP the 3x3x3 animation ???

by megasound on Mon Jan 25, 2010 3:45 am

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
megasound
 
Posts: 4
Joined: Sun Jan 24, 2010 7:55 am

Re: ??? how to LOOP the 3x3x3 animation ???

by charliex on Mon Jan 25, 2010 3:59 am

try this.
Attachments
ledcubetest.c
wrapped with infinite for
(9.18 KiB) Downloaded 377 times
http://032.la - Null Space Labs.
charliex
 
Posts: 179
Joined: Sat Nov 28, 2009 5:54 pm
Location: Las Vegas

Re: ??? how to LOOP the 3x3x3 animation ???

by megasound on Mon Jan 25, 2010 5:32 am

MANY THNKS MAN!
i will give it a try....

m
megasound
 
Posts: 4
Joined: Sun Jan 24, 2010 7:55 am

Re: ??? how to LOOP the 3x3x3 animation ???

by megasound on Mon Jan 25, 2010 3:12 pm

THANKX man
its working GREAT

thankx for aal the support !!!
m
megasound
 
Posts: 4
Joined: Sun Jan 24, 2010 7:55 am

Re: ??? how to LOOP the 3x3x3 animation ???

by charliex on Mon Jan 25, 2010 3:53 pm

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.
http://032.la - Null Space Labs.
charliex
 
Posts: 179
Joined: Sat Nov 28, 2009 5:54 pm
Location: Las Vegas

Re: ??? how to LOOP the 3x3x3 animation ???

by stevenl1 on Sun Jun 13, 2010 3:33 pm

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.
Code: Select all | TOGGLE FULL SIZE
{ 0b000, 0b000, 0b000, 0b000, 0b000, 0b000, 0b000, 0b000, 0b000,     0 },  // this is a dummy element for end of table (duration=0)
stevenl1
 
Posts: 19
Joined: Tue Jun 08, 2010 10:54 am

Re: ??? how to LOOP the 3x3x3 animation ???

by mtbf0 on Sun Jun 13, 2010 10:05 pm

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.


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.

maybe.
"i want to lead a dissipate existence, play scratchy records and enjoy my decline" - iggy pop, i need more
User avatar
mtbf0
 
Posts: 1645
Joined: Sat Nov 10, 2007 12:59 am
Location: oakland ca

Re: ??? how to LOOP the 3x3x3 animation ???

by mtbf0 on Sun Jun 13, 2010 10:19 pm

mtbf0 wrote:maybe.


ok. looked at the code and now i'm pretty sure.

when the code finishes interpreting itself as image data it will probably find some zeroed out code space and stop there.
"i want to lead a dissipate existence, play scratchy records and enjoy my decline" - iggy pop, i need more
User avatar
mtbf0
 
Posts: 1645
Joined: Sat Nov 10, 2007 12:59 am
Location: oakland ca

Please be positive and constructive with your questions and comments.