View Single Post
  #4   Spotlight this post!  
Unread 21-03-2005, 21:39
dm0ney's Avatar
dm0ney dm0ney is offline
Will Code For Food (Food Optional)
AKA: Deepak Mishra
None #0217 (The ThunderChickens)
Team Role: Alumni
 
Join Date: Jan 2005
Rookie Year: 2004
Location: Shelby Twp., MI
Posts: 48
dm0ney will become famous soon enough
Send a message via AIM to dm0ney
Re: Program does not end

While loops are tricky in robotics programming because only the code section within the loop runs until it is broken. Since the sensors are read outside of the loop itself, the loop is infinite.

Another implementation might be like this:
'pseudocode'

if (l teeth < 4 || r teeth < 4)
{
run motors;
}
else
{
motors = 127;
}

The question I ask is if the code is meant to turn the robot, why would the left and right sides both count similarly? Are they on the same gear as a redundancy check? The real question I ask is are the sensors on the robot so one is on each side of the robot, or are they positioned differently?
__________________

Alumni
Team #217, The ThunderChickens



Student, Class of 2009
California Institute of Technology