|
Re: PhotoSwitch programming trouble!!
I didn't loo through your code at all, but here's what I would do with the case where all sensors are off the line.
At the end of each case where at least one sensor is on the line store what case the robot is in to a variable (could be called something like LastCase). In the 000 case, check the LastCase variable to decide which direction to turn. Do not update the LastCase variable in the 000 case. If it takes your robot more than one loop to find the line again you want to make sure that it will keep turning the same direction.
__________________
2007 Wisconsin Regional Highest Rookie Seed & Regional Finalists (Thanks 930 & 2039)
2008 MN Regional Semifinalists (Thanks 2472 & 1756)
2009 Northstar Regional Semifinalists (Thanks 171 & 525)
|