Shop OBEX P1 Docs P2 Docs Learn Events
How to pass value in array[] to cog2 once cog1 stop? — Parallax Forums

How to pass value in array[] to cog2 once cog1 stop?

zpuazpua Posts: 33
edited 2011-08-06 11:48 in Propeller 1
Can anyone let me know anything wrong with this source code?

Array2[J]:=A
t:=t+1
waitcnt(clkfreq+cnt)
'ReceiveArray (@Array1,@Array2)
cogstop(0)


PUB Start2(I,J):Success


Stop
success:=( cog :=cognew(ReceiveArray(@long[Array1][5],@long[Array2][20]), @Stack1)+1)

PUB Stop

If cog
cogstop(cog~-1)

PUB ReceiveArray(temp1, temp2)

debug.start(31, 30, 0, 38400)
debug.tx(13)
waitcnt(clkfreq+cnt)
temp2:=Array2[5]
debug.str(string(13,"x="))
'debug.dec(temp2)
debug.str(fString.FloatToString(temp2))
Sign In or Register to comment.