|
Autonomous Program
Hi, we are currently working on a new autonomous program which uses infared sensors for more accurate readings I know several teams have done this. Anyways this is what we have come up w/ so far... can anyone spot a mistake? It tokenizes but there is a Basic run error when putting it on the robot.
if auton_mode=1 then auto1:
goto end_auto_loop:
auto1:
first:
if dist>7 then end_first:
drive_R=0 'ur going backwards remember
drive_L=0
if rc_sw3=0 then end_auto_loop:
dist=dist + whlc
goto end_auto_loop:
end_first:
turn:
if dist>9 then end_turn:
drive_R=difrdir
drive_L=difldir
if rc_sw3=0 then end_auto_loop:
dist=dist + whlc
goto end_auto_loop:
end_turn:
open_pnuematics:
if dist>10 then end_open_pnuematics:
p1_sw_trig=1 'open lower pneumatic
p2_sw_top=1 'close shoulder pneumatic
end_open_pnuematics:
straight:
if dist>16 then end_straight:
drive_R=255 'straight now
drive_L=255
if rc_sw3=0 then end_auto_loop:
dist=dist + whlc
goto end_auto_loop:
end_straight:
straight2:
if dist>21 then end_straight2:
drive_R=255 'straight now
drive_L=255
end_straight2:
finish:
drive_R=127
drive_L=127
p1_sw_top=1 'close lower pneumatic
p2_sw_top=1 'open shoulder pneumatic
end_auto_loop:
__________________
Team 701
|