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

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
{{ Output.spin }}
VAR
PUB Start(Pin, Delay, Count): Success
{{Start new blinking process in new cog; return TRUE if successful}}
PUB Stop
{{Stop toggling process, if any.}}
PUB Active: YesNo
{{Return TRUE if process is active, FALSE otherwise.}}
PUB Toggle(Pin, Delay, Count)
{{Toggle Pin, Count times with Delay clock cycles in between.}}
Page 118 · Propeller Manual v1.0
long Stack[9]
byte Cog
Stop
Success := (Cog := cognew(Toggle(Pin, Delay, Count), @Stack) + 1)
if Cog
YesNo := Cog > 0
If Count = 0, toggle Pin forever.}}
dira[Pin]~~
repeat Count
repeat
while Count := --Count #> -1
Cog~
cogstop(Cog~ - 1)
!outa[Pin]
waitcnt(Delay + cnt)
'Stack space for new cog
'Hold ID of cog in use, if any
'Set I/O pin to output…
'Repeat for Count iterations
'Repeat the following
' Toggle I/O Pin
' Wait for Delay cycles
'While not 0 (make min -1)
'Clear Cog ID variable

Related parts for 122-32000