symbol RightDetect = B0 symbol LeftDetect = B1 symbol distance = B2 symbol counter = B3 symbol RightDistance = B4 symbol LeftDistance = B5 symbol left = 1 symbol right = 4 Proximity_Detect: RightDistance = 7 LeftDistance = 7 for counter = 1 to 6 CheckRight: if RightDistance < 7 then CheckLeft low right high left gosub Flash RightDetect = pin3 '0 = detect, 1 = no detect pwmout 2 off pause 2 if RightDetect = 1 then CheckLeft RightDistance = counter CheckLeft: if LeftDistance < 7 then FinishCheck low left high right gosub Flash LeftDetect = pin3 '0 = detect, 1 = no detect pwmout 2 off pause 2 if LeftDetect = 1 then FinishCheck LeftDistance = counter FinishCheck: if LeftDistance < 7 then IsRight7 goto Repeat_Flash IsRight7: if RightDistance < 7 then Report Repeat_Flash: next Report: ' sertxd (13,10,"L",#LeftDistance,"R",#RightDistance) serout 0,T1200_4,(255,"L",LeftDistance,"R",RightDistance) goto Proximity_Detect Flash: if counter > 1 then Check33 gosub kHz32 goto End_Flash Check33: if counter > 2 then Check34 gosub kHz33 goto End_Flash Check34: if counter > 3 then Check35 gosub kHz34 goto End_Flash Check35: if counter > 4 then Check36 gosub kHz35 goto End_Flash Check36: if counter > 5 then Check37 gosub kHz36 goto End_Flash Check37: if counter > 6 then Check38 gosub kHz37 goto End_Flash Check38: gosub kHz38 End_Flash: return kHz38: pwmout 2,25,53 ' 14 inches return kHz37: pwmout 2,26,54 ' 10 inches return kHz36: pwmout 2,27,56 ' 9 inches return kHz35: pwmout 2,28,57 ' 6 inches return kHz34: pwmout 2,28,59 ' 5 inches return kHz33: pwmout 2,29,61 ' 3 inches return kHz32: pwmout 2,30,63 ' 2 inches return