This is the PID line follower code that we developed in high school that won us many prestigious robotics competitions. The code is written in arduino language which has been derived from C++ and can be run on arduino microcontroller by making minor changes in the program. We used the pololu microcontroller and thus code is configured accordingly. The algorithms concept can be learnt from here: https://www.pololu.com/docs/0J21/7.c and other online sources. Feel free to use the code according to your needs.