In my first mechatronics course we had to design a car that would line track and pick up balls on the way. Then drop off the balls at the beginning of the track. All of this one done with a microcontroller programmed in assembly. There was no human interaction other turning it on at the start line.
Turning: What made our project different from the rest was the tractor turning; all the other projects did tank turns. Tractor turns are where you brake the inner wheel and continue to power the outer wheel; tank turns however, reverse the inner wheel and keep powering the outer wheel forward. This difference seems minuscule until you look at the code required to achieve such a feat.
Line tracking: We sensed the line with an infrared LED and an infrared transistor. When the light from the LED hit the table, it dispersed, and so the transistor didn't have very much base current. When the light hit the smooth reflective tape, it bounced back more directly and hit the transistor creating base current. The difference between these two situations is what we used to tell the difference between table and the line and thus line track.
Motor Control: We tried using the PWM on the microcontroller through the H-bridges in order to achieve slow smooth changes in speed, but this proved to be more complicated then necessary and didn't adjust fast enough; thus we simply turned off and coasted the motor when it was off center, which created some nice tight line tracking. We even moved the project off center to keep it off the side of the table by writing the program to ignore different infrared sensors.
Download: Robo.s (Source Code for Microcontroller)