Hey guys, Cycloned here. I’m a newbie who’s just started Arduino programming so I barely know anything. Doing a HELL of research I’ve managed to put together a PID line follower that works, except for 1 issue - gaps in the line it’s following throws it off. When it reaches the end of the line it follows, it rotates clockwise in place (one motor turns off, one remains on). I want it to keep going forward, how can I accomplish that?
Here’s the code: pastebin.com/hnmUHcxQ
I’m using an Arduino Uno, 6 QTR sensors, TB6612FNG motor driver and some pololu micro motors. As I’ve mentioned, I’m a complete newbie, so I know that I need to add a n if statement where if the sensors all return 0 then the robot should continue forward and not turn. The problem is I dont know where and how to add this statement. Please help!