code for a wall and line follower project

I am using a standard atmega 328 arduino with a 5 sensor arrays at bottom to recognize line and 1 on each side to recognize white coloured wall....the line could be black on white surface or vice-versa.......I am unable to come up with a code for that using PID....if anyone here knows it,please answer me. Thankx.

qwerty1234:
I am unable to come up with a code for that using PID

Which part of the solution are you stuck on?

Which part of the solution are you stuck on?

The part after:

/* My code goes here */

Hi, this is where you need to go to the learning section of this site and run some simple programs.
This will get you used to programming the arduino.
Do various bits of what you require for your follower separately the when you have them working put them together.
This forum is to help you develop your programming skills, not to write the complete program.
We will suggest methods and some program clips to guide you.
First of all, what are your 5 sensors and have you got them mounted to your follower, a picture of the project would be a great help.
This process will take time but it is the best way to learn how to program the arduino.
Tom.. :slight_smile: