This is a piece of program for LEGO robots using subsumption architecture. this achieves functions of finding lines, following line, avoiding obstacles and stopping at the middle of the longest straight line(not finished).