Cobalt
11-09-2006, 05:01 AM
The question is simple, and I hope that the answer is simple too:
When launching a new cog, you use the cognew command (we're talking spin). The command requires you define it a stack to use, for example:
I have a program that I want to launch a cog to do some talking with Phil's Voice synth object while other things are going on in the main cog. It would look something like this:
cognew(t.say("Hello"), @stack)
thats for example, I don't know how "Hello" would sound...
anyhow, the @ stack would be defined in the VAR block, but how do i determine what type of var (i.e. byte, word, long) to use, and what its size would be? (ex. long stack[10])
I looked over the manual, and refered to the beginning of it where it gives the basics of spin language by making multiple LED's flash. It just makes no sence to me as to how to figure out the size of the stack. http://forums.parallax.com/images/smilies/eyes.gif
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
while alive = 1
wakeup
program(propeller)
eat(3)
sleep(7)
When launching a new cog, you use the cognew command (we're talking spin). The command requires you define it a stack to use, for example:
I have a program that I want to launch a cog to do some talking with Phil's Voice synth object while other things are going on in the main cog. It would look something like this:
cognew(t.say("Hello"), @stack)
thats for example, I don't know how "Hello" would sound...
anyhow, the @ stack would be defined in the VAR block, but how do i determine what type of var (i.e. byte, word, long) to use, and what its size would be? (ex. long stack[10])
I looked over the manual, and refered to the beginning of it where it gives the basics of spin language by making multiple LED's flash. It just makes no sence to me as to how to figure out the size of the stack. http://forums.parallax.com/images/smilies/eyes.gif
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
while alive = 1
wakeup
program(propeller)
eat(3)
sleep(7)