help error at (46,18) expected "," ?????
purplemonkey
Posts: 89
i keep getting this error with this command
COGNEW(main(16,clkfreq/50), @stack[0])
error at (46,18) expected ","
any ideas as its driving me nuts!????
COGNEW(main(16,clkfreq/50), @stack[0])
error at (46,18) expected ","
any ideas as its driving me nuts!????
Comments
VAR
LONG stack[20]
CON
_clkmode = xtal1 + pll16x
_xinfreq = 5_000_000
txpin = 16
freq1 = 500
freq2 = 1000
delta = 50000
txfreq = 92_500_000.0
freqb = round(txfreq * 4_294_967_296.0 / (16.0 * 80_000_000.0))
PUB main | numclks1, numclks2
dira := 1 << txpin
numclks1 := clkfreq / (2 * freq1)
numclks2 := clkfreq / (2 * freq2)
ctrb[30..26] := %00010
ctrb[25..23] := 7
ctrb[5..0] := 16
repeat
' Generate the first frequency for one-half second
repeat freq1 >> 1
frqb := freqb + delta
waitcnt(numclks1 + cnt)
frqb := freqb - delta
waitcnt(numclks1 + cnt)
' Generate the second frequency for one-half second
repeat freq2 >> 1
frqb := freqb + delta
waitcnt(numclks2 + cnt)
frqb := freqb - delta
waitcnt(numclks2 + cnt)
cognew(main(16,clkfreq/50), @stack[0])
i'm just trying to get my head around running the same program on different cogs but just changing the pin number and the frequency
I can't figure out also which part of the program defines which cog it runs on?
This is
is not the same as
Also, please use the [ code ] [/ code ] tags to wrap your source code when posting to the form. It makes the code easier to read.
Really I just want to know the process for repeating the whole thing on a different cog? Just want to know what the code is?