Is there a comprehensive description of how to pass variable (variable pointers). E.g between cogs, between objects that are then loaded into cogs etc?
There are probably lots of valid ways to skin that cat. I've attached a demo program that will be included in my July Nuts & Volts column.
The LED object (jw_bicolor_v3.spin) provides color, bi-phase blinking, and pwm brightness control of a two-lead, bi-color (green/red) LED. The brightness is controlled by PWMing the dira control pin for one of the LEDs; I modulate the direction pin as it's a bi-color LED and current can be flowing in either direction at any given time. The object has a brightness control variable and a method for requesting the address of that variable.
The demo program requests the address of the brightness variable and then uses that in another cog (running the fader method) that can ramp the brightness in one direction or the other.
Again, this is just one way to do this, I'm sure the hardcore Propeller gurus will demonstrate others.
Comments
The LED object (jw_bicolor_v3.spin) provides color, bi-phase blinking, and pwm brightness control of a two-lead, bi-color (green/red) LED. The brightness is controlled by PWMing the dira control pin for one of the LEDs; I modulate the direction pin as it's a bi-color LED and current can be flowing in either direction at any given time. The object has a brightness control variable and a method for requesting the address of that variable.
The demo program requests the address of the brightness variable and then uses that in another cog (running the fader method) that can ramp the brightness in one direction or the other.
Again, this is just one way to do this, I'm sure the hardcore Propeller gurus will demonstrate others.
The propeller manual is a bit better than the last wrt variables