Expected operator error
Skynet_Inc
Posts: 5
Hi there, Im trying to learn spin and can't figure out how to solve this error I keep getting:
The aim of this code Im writing is simply to print 2 values to the serial terminal that are counting at different rates. Here is my code:
obj
pst : "parallax serial terminal"
CON
_clkmode=xtal1+pll16x
_xinfreq=5000000
var
long X
long Y
pub main
pst.Start(115200) 'starting the terminal
Y:=5
X:=0
pst.clear
repeat
pst.dec(X) 'printing value x to terminal
pst.str(String(" " )) 'print a space
pst.dec(Y) 'print value y
pst.Newline 'print new line
Y=Y+5
X++
waitcnt(clkfreq+cnt)
The error I have is with the Y=Y+5 line. I get Error at (24,6) Expected operator. I realise that this is probably a very trivial error but I'm new to spin.
The aim of this code Im writing is simply to print 2 values to the serial terminal that are counting at different rates. Here is my code:
obj
pst : "parallax serial terminal"
CON
_clkmode=xtal1+pll16x
_xinfreq=5000000
var
long X
long Y
pub main
pst.Start(115200) 'starting the terminal
Y:=5
X:=0
pst.clear
repeat
pst.dec(X) 'printing value x to terminal
pst.str(String(" " )) 'print a space
pst.dec(Y) 'print value y
pst.Newline 'print new line
Y=Y+5
X++
waitcnt(clkfreq+cnt)
The error I have is with the Y=Y+5 line. I get Error at (24,6) Expected operator. I realise that this is probably a very trivial error but I'm new to spin.
Comments
Don't forget to indent everything under the "repeat" You probably already did, but the forum software tosses out the spacing if you don't use the Code tags