122-32000 Parallax Inc, 122-32000 Datasheet - Page 191

MANUAL PROPELLER

122-32000

Manufacturer Part Number
122-32000
Description
MANUAL PROPELLER
Manufacturer
Parallax Inc
Datasheets

Specifications of 122-32000

Accessory Type
Manual
Lead Free Status / RoHS Status
Lead free / RoHS Compliant
For Use With/related Products
Propeller Education (PE) Kit
Lead Free Status / Rohs Status
Lead free / RoHS Compliant
using code from the same Spin object, they are running independently. The “
here>
Propeller Assembly Code (Syntax 2)
To run Propeller Assembly code in another cog, the
the assembly routine and a value that can optionally be used by the assembly routine. For
example:
VAR
PUB Start(Pos) : Pass
PUB Stop
This example shows two methods,
of that object is such that it needs to launch another cog to run an assembly routine, called
Update
The
whether or not a new cog was successfully started. First, it calls
Pos)
parameter. Additionally, it takes the value returned by
cog, or -1 if none available, adds 1 and stores the result in the
cognew(@Update, Pos) + 1
Pass
started, that new cog begins loading up the Propeller Assembly code called
it. Meanwhile this object’s
representing the new cog’s ID, 0 through 7. If no cog was started,
byte Cog
'Start a new cog to run Update with Pos,
'return TRUE if successful
Pass := (Cog := cognew(@Update, Pos) + 1) > 0
'Stop the cog we started earlier, if any.
if Cog
” with the address of the
, to
Start
cogstop(Cog~ - 1)
” line can be replaced with code that uses the value of
(not shown), and pass it a parameter,
TRUE
method takes a single parameter,
; otherwise
'Used to store ID of newly started cog
Pass
”. Lastly, if
Cog
is set to
Update
variable (in the original cog) will be in the range 1 to 8,
Start
routine as the first parameter and
FALSE
4: Spin Language Reference –
Cog
and
Pos
. At this point, if a new cog was successfully
is greater than zero (0) it sets its return value,
Stop
. Later it may need to stop that new cog.
Pos
, within a hypothetical object. The design
, and returns
COGNEW
COGNEW
X
in some way.
command needs the address of
Propeller Manual v1.0 · Page 191
, which is the ID of the new
TRUE
COGNEW
Cog
Cog
will be 0.
or
, “
variable; “
Pos
FALSE
cognew(@Update,
Update
as the second
to indicate
, and runs
<check X
Cog :=

Related parts for 122-32000