i fixed some of the code but it still isn’t working
main
T_IR var word
pan_left var word
pan_right var word
R_IR var word
pan_left = servo p15,1500
pan_right = servo p4,-1500
mid var word
mid = servo p4,0
if R_IR<100 then pan_left *R_IR
endif
if R_IR>100 then pan_right *R_IR
endif
if R-IR =100 then mid *R_IR
endif
goto main
and i use the “main” command all the time
and i even tried using a different program with that, so whats wrong?
Okay… As I said, I’m not completely dissecting your code - just tossing out some ideas. As I don’t currently have access to my hardware, or the specific sensor that you’re trying to work with, I won’t be able to do much with it anyway.
Earlier, you quoted the error message you were receiving:
Compiling...
C:\DOCUMENTS AND SETTINGS\BRANDON\MY DOCUMENTS\BASIC.BAS
Error: FILE C:\DOCUMENTS AND SETTINGS\BRANDON\MY DOCUMENTS\BASIC.BAS(LINE 8) : [TOKEN P4] : Unexpected token type
Errors Detected
One of the more useful aspects of these errors is that it tells you where it is seeing the error. Pay particular attention to the line that says: