Can't stop processes with COGSTOP
Wolfbrother
Posts: 129
I'm almost sorry to post this one, except I can't see the answer no matter what I try.
When I exit my main repeat loop, I thought I understood that it starts executing the next instruction out of the loop you just finished. So in my code I tried to stop the motors from spinning by using COGSTOP.( commented out for the moment) ·That didn't work, so then I tried passing zeroing values to the motors. That hasn't worked either. Using the serial terminal, I can see that I get to the DONE, but what's happening?
Thanks in advance,
Dave
When I exit my main repeat loop, I thought I understood that it starts executing the next instruction out of the loop you just finished. So in my code I tried to stop the motors from spinning by using COGSTOP.( commented out for the moment) ·That didn't work, so then I tried passing zeroing values to the motors. That hasn't worked either. Using the serial terminal, I can see that I get to the DONE, but what's happening?
Thanks in advance,
Dave
Comments
So does that mean I should use COGINIT and force them to be 1..4? I just followed the example in the lab, to get the idea that they started in order. If that isn't the best method what would be?
Thanks,
Dave
X := cognew(mycog, @stack)
..
Cogstop(X)
If you really want to do it that way.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Life may be "too short", but it's the longest thing we ever do.
-Phil
Thanks for the suggestions. I took the advice and modified the code to return which cog was started. I also used the serial terminal to output this info to my screen. It returns a 5, so I am guessing that's correct. But when I use cogstop(dcmtrcog) it still doesn't stop the cog for the motor. I also changed where I zero the motor speed out and it doesn't change the motor speed at all. It's like it doesn't reach these instructions, but it does print "done" to my screen. What am I missing?
-Phil
Thanks,
Dave