'Public' variables -
TE44
Posts: 42
Can variables be·shared between and updated from different methods and different cogs ? Similar to a Public variable in VB ?
·
·
Comments
That depends on whether they're in the same object. Variables (VAR or DAT sections) are known by all methods in the object. It doesn't matter what cog(s) is running (you can have multiple cogs running on the code in one object). Variables cannot be referenced from another object. You can create methods in an object that make a variable or the address of a variable available to other objects like
Yet again ... spot on ...thank you.... your help is much appreciated .. this month was spent entirely playing around with the propellor and I am finally able to do the many things I set out to do ... thanks to your help.
As a side note : I have also managed to kill 2 40pin dil props in breadboard - seems strange - even though I had regulators & diodes in reverse across the supply & caps etc (all as recommended and more) they worked fine and programmed ok but when I removed the power and reapplied it the props were dead - each time though I had ascreen attached as per schematics (except for led's and associated resistors) - do the LED's in the schematic play some additional role in dissipating unwanted spikes ? - or is this just a coincidence. Removing power this way (same power supply) using the demo board does not cause any difficulty. Is there some additional 'soft start/stop' circuitry I have missed ? I find this strange as all good practice was followed with respect to power supply stage.
Has anyone else killed a prop for what is an unknown reason (at least unknown for the moment)?
Best to post this as a new thread
Post Edited (TE44) : 1/24/2007 4:54:49 PM GMT
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Paul Baker
Propeller Applications Engineer
Parallax, Inc.