View Single Post
  #12   Spotlight this post!  
Unread 07-02-2005, 14:06
Kevin Watson's Avatar
Kevin Watson Kevin Watson is offline
La Caņada High School
FRC #2429
Team Role: Mentor
 
Join Date: Jan 2002
Rookie Year: 2001
Location: La Caņada, California
Posts: 1,335
Kevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond repute
Re: Syntax Problems...

Quote:
Originally Posted by katkana
So... onto business. Here's the entire code:
There's another problem. You're not accounting for all the the counter states, which will cause your 'bot to not function the way you think it will. As an example of what I'm referring to, have a look at the code below:

Code:
else if(counter > 120 && counter < 240) /* if 2-4 seconds have passed */
{
   pwm01=155; /* right motor forward */
   pwm02=27; /* left motor backward */
   pwm03=pwm04=127; /*arm motors off */
}
else if(counter > 240 && counter < 360) /* if 4-6 seconds have passed */
{
   pwm01=pwm02=pwm03=127; /* stop */
   pwm04=200; /* upper arm joint raises */
}
What happens when counter == 240? I think you should be using a >= or <= in there someplace (This bug bites me all the time <grin>).

-Kevin
__________________
Kevin Watson
Engineer at stealth-mode startup
http://kevin.org