Need help with "while" error ...
Hello,
I am getting a "while"·error when running the following code on page 118 of the prop manual. Any help would be appreciated. The exact error is
"expected an instruction or varible".
CON
· _CLKMODE = RCSLOW
VAR
· LONG STACK[noparse][[/noparse]9]
· Byte Cog
PUB Start(Pin, Delay, Count): Success
Stop
Success := (Cog := cognew(Toggle(Pin, Delay, Count), @Stack + 1))
PUB Stop
· if Cog
··· cogstop(Cog~ - 1)
PUB Active: YesNo
· YesNo := Cog > 0
··
PUB· Toggle(Pin, Delay, Count)
·· dira[noparse][[/noparse]Pin]~~
·· repeat
··· !outa[noparse][[/noparse]Pin]
··· waitcnt(Delay + Count)
· while Count := - -Count #> -1
· Cog~·
I am getting a "while"·error when running the following code on page 118 of the prop manual. Any help would be appreciated. The exact error is
"expected an instruction or varible".
CON
· _CLKMODE = RCSLOW
VAR
· LONG STACK[noparse][[/noparse]9]
· Byte Cog
PUB Start(Pin, Delay, Count): Success
Stop
Success := (Cog := cognew(Toggle(Pin, Delay, Count), @Stack + 1))
PUB Stop
· if Cog
··· cogstop(Cog~ - 1)
PUB Active: YesNo
· YesNo := Cog > 0
··
PUB· Toggle(Pin, Delay, Count)
·· dira[noparse][[/noparse]Pin]~~
·· repeat
··· !outa[noparse][[/noparse]Pin]
··· waitcnt(Delay + Count)
· while Count := - -Count #> -1
· Cog~·
Comments
repeat while condition
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Who says you have to have knowledge to use it?
I've killed a fly with my bare mind.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Paul Baker
Propeller Applications Engineer
Parallax, Inc.