View Single Post
  #6   Spotlight this post!  
Unread 21-02-2005, 16:32
AIBob's Avatar
AIBob AIBob is offline
AI Programmer
AKA: Bob Frank DOT org
FRC #0358 (Hauppauge Robotic Eagles)
Team Role: Alumni
 
Join Date: Jan 2005
Rookie Year: 2003
Location: Long Island, NY (in Binghamton now)
Posts: 297
AIBob is a splendid one to beholdAIBob is a splendid one to beholdAIBob is a splendid one to beholdAIBob is a splendid one to beholdAIBob is a splendid one to beholdAIBob is a splendid one to beholdAIBob is a splendid one to behold
Send a message via ICQ to AIBob Send a message via AIM to AIBob Send a message via MSN to AIBob Send a message via Yahoo to AIBob
Re: quick c question

Code:
if (counter<60)
{
arm = 0; 
}
tracker = counter;
else if (counter<tracker+32)
{
arm = 127; 
l_motor=r_motor=191; 
}
tracker = counter;
else if(counter < tracker + 55)
{
l_motor=r_motor=127; 
arm = 255; 
}
You have it being set between the else ifs.
there is not if that the else is attached to.
This is what is giving you the error, not the variable setting itself, just the placement of the setting.

Also note: you are setting tracker to counter before you check if it less than counter.
__________________
- from B B frank


Last edited by AIBob : 21-02-2005 at 16:36.