Shop OBEX P1 Docs P2 Docs Learn Events
Expected operator error — Parallax Forums

Expected operator error

Skynet_IncSkynet_Inc Posts: 5
edited 2014-07-23 07:24 in Learn with BlocklyProp
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.

Comments

  • Skynet_IncSkynet_Inc Posts: 5
    edited 2014-07-23 06:02
    Don't worry. Ive just had a look in the proppeler manual. It should be y:=y+5 not y=y+5. I am still thinking in C. my bad.
  • PublisonPublison Posts: 12,366
    edited 2014-07-23 07:24
    Welcome to the forums!

    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
Sign In or Register to comment.