Having difficulties starting cogs
kutalinelucas
Posts: 80
I'm having some difficulties starting a new cog and was wondering if somebody could help me out...
I'm writing a program which reads in 2 variables, the first to identify a specific motor, the second for the required rotation of that motor. All i'm looking to start a new cog and pass these two variables, do the move (while the first two cogs are waiting for futher instructions) and then exit the cog when completed.
So far the data is read by 2 cogs and succesfully passed to the object posted below, but for some reason I can't get a new cog to run...could somebody please help?
...i'd be happy to post the rest of the code if it'll be helpful
Martyn.
I'm writing a program which reads in 2 variables, the first to identify a specific motor, the second for the required rotation of that motor. All i'm looking to start a new cog and pass these two variables, do the move (while the first two cogs are waiting for futher instructions) and then exit the cog when completed.
So far the data is read by 2 cogs and succesfully passed to the object posted below, but for some reason I can't get a new cog to run...could somebody please help?
CON delay = 3_000_000 VAR long rotation long motmov Long motstack[12] OBJ PUB start(reconstructed_data, Motor_ident) cognew(turn_motor,@motstack) motmov := reconstructed_data if motmov < 30 !OUTA[9] if motmov > 30 !OUTA[8] PUB turn_motor Repeat !OUTA[10] waitcnt(Delay + cnt)
...i'd be happy to post the rest of the code if it'll be helpful
Martyn.
Comments
Sorted for now...thanks