PID line follower help

Hey everyone. I have a line following competition this weekend and I have prepared a simple robot for it. My robot is tracing lines pretty well, the only issue is that when it comes to the end of a line, it rotates in one place. I want to change it so that it continues to go forward after the line finishes because the competition track has several gaps in the line. Since I am very new to Arduino, I must admit that I have copied the program from online, and have only experimented with the values to get the line tracing to work. I have an understanding of the way the code works but I do not have enough time to go in depth into it and recode things myself. I will however be making my own program after the competition.

Can anyone help me out with how to accomplish this?

http://pastebin.com/hnmUHcxQ

 

First, this is a
First, this is a competition. Just copying code doesn’t really help you learn and it doesn’t give anybody else a worthy adversary.

Second, while I have no code, you can search within these postings.

Third, after a line ends have your robot continue like it was going for a short while, but enough to pick up the line again. That should do what you need. If it doesn’t find the continuation in this short period, then go into whatver routine you have for finding the line when it’s lost.