question about cogs
10gigbill
Posts: 79
in Propeller 1
I will try to post my code ....
'This is for blink project ' started Feg 24-2016 ' cogblink Con ' _Clkmode = Xtal1 + pll16x ' _Xinfreq = 5_000_000 ' high = 1 'FEB 24-2016 low = 0 ' out = $FF Var byte X long stack[40] 'for blink long stack1[40] 'for flash Obj pst:"Parallax Serial Terminal" Pub main DirA[0..7]:= out DirA[8..15]:= out DirA[16..23]:= out DirA[24..29]:= out DirA[31]:=0 DirA[30]:=1 cognew (blink,@stack) cognew(flash,@stack1) outA[27] := 1 'set to tx pst.Start(38_400) 'Set Terminal to 38400 baud X := 1 'pst knows pins 30,31 repeat pst.Char("X") waitcnt(50_000_000+ cnt) pst.Char ("Z") waitcnt(50_000_000+ cnt) PUB blink if X==1 repeat outA[1] := 1 waitcnt(30_000_000 + cnt) outA[1] := 0 waitcnt(30_000_000 + cnt) PUB flash if X==1 repeat outA[2] := 1 waitcnt(10_000_000 + cnt) outA[2] := 0 waitcnt(20_000_000 + cnt)that do not work
Comments
I would like to have seperate objects running in there own cogs.
this example just keeps printing x,z ... and no blinking.
what did I miss....?
-Phil
and also, I think my brain is going away. thanks guys...
Bill