Program problems

I have started programming my robotic pbasic,since I’m using a basic stamp, and I have have a problem with programming.I have put a * symbol before and after the problem.Thanks for the help :slight_smile:

[code]’ {$STAMP BS2}
’ {$PBASIC 2.5}
DEBUG “it works”
FREQOUT 4, 2000, 3000
counter VAR Word
Ping_Pin CON 0
InConstant CON 890
inDistance VAR Word
time VAR Word

DO

FOR counter = 1 TO 360
PULSOUT 13, 850
PULSOUT 12, 650
PAUSE 20

PULSOUT Ping_Pin, 5
PULSIN Ping_Pin, 1, time
inDistance = inConstant ** time
DEBUG CR, DEC inDistance
PAUSE 200
IF(inDistance < 3)THEN ’ the program tells me " Error ‘IF’ without ‘ENDIF’
PULSOUT 13, 850
PULSOUT 12, 850

END[/code]
'the ping sensor code came from “http://learn.parallax.com/KickStart/28015

you are missing an ENDIF line that closes the if statement.