Line + Wall Follower

I didn't understand how to write the code for a line follower and a wall follower. At first there is line following path and then there is wall following path. I want to use PID for line following. I have Qtr-8rc and adafruit dual H-bridge motor driver.

What have you tried?

If this is your first programming project it is a very challenging one and I suggest you start with something simpler so you can learn the basics.

If you just want someone to write code for you please ask in the Gigs and Collaborations section of the Forum and be prepared to pay.

...R

I don't want somebody to write code for me. All I want is how to link up both the projects?

Are you saying you've written a line follower and a wall follower and don't know how to merge the two together?

Yes, exactly @groove

Well, first, you have to define how the combined code is meant to behave.

In the arena at the start it is a line following path and after there is a wall trailing zone where the bot should follow the wall.
In PID the bot tries to find line if the bot cannot detect line. But at the wall following arena line is not present, so how to tell the bot to stop following the line now and start following the wall?

if (noLinePresent)
{
  stopLineFollowing ();
  followWall();
}

whkv:
Yes, exactly @groove

Well why have you not posted the two programs?

...R

Groove:

if (noLinePresent)

{
 stopLineFollowing ();
 followWall();
}

Might be a false identification of not having a line when it just actually can’t find it: might be better to make the if condition the presence of a wall rather than absence of a line.

Groove:
Are you saying you’ve written a line follower and a wall follower and don’t know how to merge the two together?

whkv:
Yes, exactly @groove

I’m very surprised OP’s capable of writing two fairly sophisticated sketches including pid, but can’t figure out how to join them together.