PID line follower

anyone have an example PID algorithm code for line follower. i want it to study.

please help me

Did you see this:

previous_error = 0
integral = 0 
  error = setpoint - actual_position
  integral = integral + (error*dt)
  derivative = (error - previous_error)/dt
  output = (Kp*error) + (Ki*integral) + (Kd*derivative)
  previous_error = error
  goto start

Pseudo code from:

No PID algo was used in the document recommended by feiutm9898. However, in my opinion, we do not need PID controller for line follower... ON-OFF control or Bang-Bang control will do...