SYMBOL Detectors = B0 SYMBOL RightDetect = BIT0 SYMBOL LeftDetect = BIT1 Line_Follower: GOSUB Forwards Check_Line_Follower: GOSUB Line_Finder_Check IF Detectors = 0 THEN Check_Line_Follower IF Detectors = 1 THEN Line_Right IF Detectors = 2 THEN Line_Left Line_in_Front: GOTO End_Line_Follower Line_Right: GOSUB Left PAUSE 120 GOTO Line_Follower Line_Left: GOSUB Right PAUSE 120 GOTO Line_Follower Line_Finder_Check: Detectors = 0 RightDetect = PIN0 LeftDetect = PIN1 RETURN Right: HIGH 2 LOW 3 LOW 4 HIGH 5 RETURN Left: 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_Line_Follower: END