View Single Post
  #2   Spotlight this post!  
Unread 13-02-2005, 17:33
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: Autonomous Code trouble

one possible problem is that you never set variable t, and you never have it do anything after the 114 loops, like neutralizing them.
Try this:
Code:
static unsigned int t=0;
 
while (autonomous_mode) /* DO NOT CHANGE! */
{
if (statusflag.NEW_SPI_DATA) /* 26.2ms loop area */
{
Getdata(&rxdata); /* DO NOT DELETE, or you will be stuck here forever! */
 
/* Add your own autonomous code here. */
t++;
if (t <114)	//edit(added): runs Forward for 113*26.2ms = 2.9606s
{
pwm01=160;
pwm02=160;
}
else
{
pwm01 = 127;
pwm02 = 127;
}
...etc...
__________________
- from B B frank


Last edited by AIBob : 14-02-2005 at 10:49.