View Single Post
  #5   Spotlight this post!  
Unread 21-02-2005, 16:17
shobuda999 shobuda999 is offline
Registered User
None #1995
 
Join Date: Jan 2005
Rookie Year: 2001
Location: Connecticut
Posts: 7
shobuda999 is an unknown quantity at this point
Re: quick c question

[above]
int counter = 0;
int tracker = 0;
counter ++
[below]

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;
}

this is for dead reckoning without any kind of sensor using a clock of sorts.
i know this seems kind of strange, the reason I'm doing it this way is so I can easily make slight changes without having to change every value

thanks,
Dan