Need a recommendation
CannibalRobotics
Posts: 535
I have been unable to get my head wrapped around where a variable lives in the prop and how it is most efficiently referenced/modified from multiple cogs. Can someone recommend a good tech note on this aspect of the architecture/language.
Thanks,
Jim-
Thanks,
Jim-
Comments
You need to be a little more specific with your request, are you talking about intraobject or interobject, are you talking about assembly to assembly, assembly to spin, or spin to spin?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Paul Baker
Propeller Applications Engineer
Parallax, Inc.
as long as all cogs are started by cognew from the SAME *.SPIN-File
you can access them simply by the name of the variable
here is a demo which shows that
if you want to access variables ACROSS different objects
define the variables in your top-object-file
and pass the ADRESS of the variables by using the "@"-operator (the adress-operator
now INSIDE the file MyObject.spin
there have to be variables for the pointervalues
best regards
Stefan
What you've posted seems unnecessarily complicated, like why are you using pointers?
You've got the simple case of a method (subroutine) that is running in its own cog with everything together in one object. Good!
Here it is simpler:
Post Edited (Mike Green) : 11/4/2008 7:50:32 PM GMT