Hello again everyone. I’ve been doing work with the BRAT robot and have been using the Atom Pro to make it autonomous. I’m laying down the groundwork for the code and I’ve run into what seems like a compiler bug. When I’m using the LOOKUP command, it’s telling me that one of the commas to separate the arguments is an invalid token type. Here’s my code:
[code]; Copyright 2008 Patrick Stoddard
; Core OS designed to make the Zoey Robot Function
;---------------------------------------Declare Pins--------------------------------------
SSC32 con p14
ping con p15
baud con i38400
;--------------------------------------Declare Servos--------------------------------------
leftHigh CON 2
leftMiddle CON 1
leftLow CON 0
rightHigh CON 16
rightMiddle con 15
rightLow con 14
horizontalPing con 3
verticalPing con 4
;------------------------------------Declare Variables-----------------------------------
positionLeft var float
positionRight var float
position var word
movetime var word
pinnum var byte
movement var byte
;------------------------------------Declare Constants-----------------------------------
d con 1
;---------------------------------Declare Constant Tables--------------------------------
servoAdj FloatTable 5.58, 0, 2.25, 0, 0, 1.08
step1 ByteTable -34, -42, 9
step2 ByteTable -29, -29, -52
step3 ByteTable -16, -34, -14
step4 ByteTable 50, 29, -11
step5 ByteTable 34, 34, 8
step6 ByteTable 27, 11, 16
step7 ByteTable 27, 4, 16
step8 ByteTable -29, -21, 16
;--------------------------------Execute Start Up Procedure------------------------------
;------------------------------------Begin Main Program----------------------------------
DO
WHILE d = 1
getstep[movement]:
if (movement = 0) then
LOOKUP stepnum, [step1, step2, step3, step4, step5, step6, step7, step8], positionLeft ;Initial error given here
LOOKUP stepnum, [step5, step6, step7, step8, step1, step2, step3, step4], positionRight ; error also given here if first LOOKUP is removed
endif
return
move[pinnum, position, movetime]:
serout SSC32, baud,"#", DEC pinnum, “P”,DEC servo0pw, “T”,DEC movetime, 13]
return
[/code]
Any help is greatly appreciated. Thanks!