SYMBOL LeftDetect = B0 SYMBOL RightDetect = B1 symbol Detected = B2 CheapBot_14: pause 1000 gosub forwards Traveller: gosub Proximity_Check Detected = LeftDetect + RightDetect if Detected = 14 then Traveller if LeftDetect < RightDetect then Turn_Right if RightDetect < LeftDetect then Turn_Left if RightDetect > 3 then Traveller gosub Freeze pause 1000 gosub Right ClearRight: gosub Proximity_Check if LeftDetect < 7 then ClearRight gosub Freeze pause 500 gosub Forwards goto Traveller Turn_Right: gosub Right gosub Proximity_Check if LeftDetect < 7 then Turn_Right gosub forwards goto Traveller Turn_Left: gosub Left gosub Proximity_Check if RightDetect < 7 then Turn_Left gosub forwards goto Traveller Proximity_Check: serin 2,T1200_4,("L"),LeftDetect,RightDetect,RightDetect return Left: HIGH 2 LOW 3 LOW 4 HIGH 5 RETURN Right: LOW 2 HIGH 3 HIGH 4 LOW 5 RETURN Backwards: HIGH 2 LOW 3 HIGH 4 LOW 5 RETURN Forwards: LOW 2 HIGH 3 LOW 4 HIGH 5 RETURN Freeze: LOW 2 LOW 3 LOW 4 LOW 5 PAUSE 500 RETURN End_CheapBot_14: END