Coginit Command is stoping program?
krazyideas
Posts: 119
Hello
I have a coginit command that is either stoping my program or is not allowing the program to pass it.
I know this because if I take it out it works just fine except I never load that cog.
It's the frist coginit in my program, I'm sure that the second one will have the same problem, but I don't know because my program doesn't get that far.
I have a coginit command that is either stoping my program or is not allowing the program to pass it.
I know this because if I take it out it works just fine except I never load that cog.
It's the frist coginit in my program, I'm sure that the second one will have the same problem, but I don't know because my program doesn't get that far.
Comments
if ina[noparse][[/noparse]27] == 0 and ina[noparse][[/noparse]26] == 1 and ina[noparse][[/noparse]25] == 1 and ina[noparse][[/noparse]24] == 0 and ina[noparse][[/noparse]23] == 0 and ina[noparse][[/noparse]22] == 0 'key q
That can be simplified to:
'define all your keys here
Key_q := %000110
if(ina[noparse][[/noparse]22..27] == Key_q)
...
if...
etc.
As for the cog problem... I don't see DegreeMark defined anywhere... Am I missing it?
But I bet I will be back later with another question
Thanks lots
Well I think what I might be doing wrong is like Mike said calling the wrong cog.
How do you retrive the cogid from cognew?? it says in the manule (if I am understanding it right) that it returns that value.
The reason that I want to use COGINIT is becasue I have two small programs that run in a cog (and 6 sets of these 2 programs that each run in there own cog but I'm just working on one small bit at a time, besides the 6 cogs are nearly identacal so if I can get one to work right the others should be easy),·· And I want to switch between the programs from the first one (ReadFireTime1)· to the second one (ExicuteFireTime1) and back again depening on if a pin is high or low
That is why I am useing COGINIT.·
If I can still use Cognew I would be ok with that, but I don't think that I can becasue in the final product all 8 cogs are running programs and then I just want to switch or change the program that these 6 (just one for now) cogs are running.· Switching From ReadFireTime1 to ExicuteFireTime1 in one cog and switch from ReadFireTime2 to ExicuteFireTime2 ect...............·· up to 6 and then back again if I want. (depending on a pin being high or low)
And ReadFireTime# and ExicuteFireTime#· both run continualy until I tell them (with that pin) to load and run the other.
The COGINIT command is still stoping my program.
And Thanks Philldapill that advice made my program look WAY better
Thought would be great
Thanks