line tracking robot pid

can any one give me a program for line tracking robot with pid or proportional

has any body built a robot with gear motor by using pwm effectively

my motors which are similar to gm9 at 300 rpm can respond good enough to pwm