Variables between Cogs
PropDev
Posts: 2
Hello,
I'm trying to figure out how to update a variable between 2 cogs. For example, lets say I have a method running in a new cog that blinks an LED at a certain speed. In my main method running in the default cog I want to update the variable that controls the speed at which the LED blinks.
Firstly, is this possible? If so, how is it done?
I'm programming in Spin.
Thanks
I'm trying to figure out how to update a variable between 2 cogs. For example, lets say I have a method running in a new cog that blinks an LED at a certain speed. In my main method running in the default cog I want to update the variable that controls the speed at which the LED blinks.
Firstly, is this possible? If so, how is it done?
I'm programming in Spin.
Thanks
Comments
so if the name of your variable would be blink_rate
you simply code
blink_rate := 15
and you are done
only global variables that are defined in another spin-file (= another object) are not directly accessible
best regards
Stefan