Looking for guidance, examples, etc on how to launch a process in another cog
Don M
Posts: 1,653
I have a main loop running a menu and I want to start other routines from the menu and keep them going but still need to have control of the main menu loop and get some data from the routine running external of the main loop. I am guessing I need to run these other routines in another cog?
If anyone can suggest some good examples or reading material on this type of thing it would be greatly appreciated.
Thanks
Don
If anyone can suggest some good examples or reading material on this type of thing it would be greatly appreciated.
Thanks
Don
Comments
I have attached a visual of what I'm trying to understand.
What do I need to learn to do this? Any references?
Thanks.
Forgetting to do this is a common mistake....
Thanks.
If the helper method lives in a different object (different SPIN file) then you have to communicate the address of said variable. So either the main program tells the child object what the address is (e.g. child.setup(@shared)) in which case the child object accesses shared through long[address]++ or it asks the child object what the address is (e.g. address := child.getAddr) and then uses the returned address like value := long[address].
Edit: Got it to work! Thanks.