Help with 18x Electric Vehicle code

I'm working on some code for an event in Science Olmpiad in New york, the code below should check input 2 for a high signal, then jump to sub Diselect, then check for the pins for the right combonations of inputs to then jump to the assosiated sub, the subs take a plse input from an optointerupt and record the length of the pulse to w0, it wil pulse the servo until w0 is equal to the assigned number.

------------------------------------------------

 

main:
if input2=1 then Diselect
goto main


Diselect:
if input0=1 then _5

goto Diselect

_5:
pulsin 7,1,w0

do
pulsout 6, 100
loop until w0=50
goto main

-------------------------------------------------------

where did I go wrong?

no updates of w0 in inner loop

It might be that w0 does not get updated while the program is running the inner loop:

do ; loop until

After all, you only write to w0 at the pulsin command. You should give the Picaxe simulator a try.

8ik

Also some description of
Also some description of what it is actually doing may help too. you just tell us what it is supposed to do.

sorry, It has to go an
sorry, It has to go an unkown distance between 5 and 10 meters in .5 meter intervals and stop on a dime