Quote Originally Posted by MrRoboto View Post
My code below does not compile, i get alot of errors(see bottom), can anyone help.
You could help yourself a lot by reading the PBP manual and learn how to assign a value to a variable.

Assuming this is your exact and complete code ( I know sometimes things don't cut and paste correctly, but I'll assume it did)
Code:
end if
ENDIF is one word, not two.

Code:
if (PORTA.2=0) then
'obstacle detected
for b0=1 to 2
gosub backup 
next
Where's the ENDIF?

Code:
  PORTB.7=high  'enable pin
  PORTB.6=low    'stop this side
Where is HIGH and LOW defined? And what are their defined values?

Code:
ERROR Line 12: ':' or '=' Expected (Token 'var') (BASIC CODE from book test.bas)
I haven't seen an error formatted like that in MeLabs PicBasicPro...unless you added the (BASIC CODE from book test.bas)
Hmmmm........