View Single Post
  #2   Spotlight this post!  
Unread 12-02-2011, 12:02
Vikesrock's Avatar
Vikesrock Vikesrock is offline
Team 2175 Founder
AKA: Kevin O'Connor
no team
Team Role: Engineer
 
Join Date: Mar 2006
Rookie Year: 2007
Location: Manchester, NH
Posts: 3,305
Vikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond repute
Send a message via AIM to Vikesrock Send a message via MSN to Vikesrock Send a message via Yahoo to Vikesrock
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)
Reply With Quote