Go to Post The FIRST program is different. It has a different purpose. It isn't superficial, it's results are long term and lasting. I hope that FIRST is still on message. - JohnBoucher [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Spotlight this post!  
Unread 03-02-2004, 12:24
sscanf sscanf is offline
Registered User
#0061
 
Join Date: Jan 2004
Location: Blackstone Valley Regional, Upton, MA
Posts: 4
sscanf is an unknown quantity at this point
Question User_Autonomous_Code() questions

OK. I'm new to FIRST but not new to C. I'm trying to understand the default FRC code. I see that main is calling User_Autonomous_Code() when the autonomous_mode flag is set and after calling Process_Data_From_Master_uP(). like so:

Code:
while (1)   /* This loop will repeat indefinitely. */
{
   if (statusflag.NEW_SPI_DATA)          
   {                                 
      Process_Data_From_Master_uP();  
      if (autonomous_mode)            
      {
        User_Autonomous_Code();       
      }
    }
    Process_Data_From_Local_IO();     
} /* while (1) */
What I don't understand is Process_Data_From_Master_uP() will in-turn call Default_Routine() which handles the operator interface. This doesn't seem correct but maybe I'm mis-understanding something.

It seems to me that the if check in main should be something more like this:

Code:
while (1)   /* This loop will repeat indefinitely. */
{
   if (statusflag.NEW_SPI_DATA)          
   {             
      GetData(&rxdata);  
      if (autonomous_mode)            
      {
        User_Autonomous_Code();        
      }
      else
      {  
         Process_Data_From_Master_uP(); //Modify to remove Get/PutData()
      }
      PutData(&txdata);
    }
    Process_Data_From_Local_IO();     
} /* while (1) */
I'm operating remotely from my team and finally got a hold of the edu robot kit and have managed to program and download it. I got started on this because there is no autonomous mode in the edu default code and want to add it, somehow simulating the autonomous_mode.

I want to be sure I'm not misunderstanding anything before I procede.

Thanks.

Dan Rasmussen
 


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
3 Questions!!! (1/5/04) Andy Grady General Forum 8 05-01-2004 16:01
$3500 limit - Who does not have questions Raul Rules/Strategy 5 12-01-2003 11:31
Update 7 - Behind Schedule (or out of questions)? archiver 2000 2 23-06-2002 22:58
height questions Team461 Off-Season Events 3 29-10-2001 21:51
Legal way to remove bottles? and other questions jrukes Off-Season Events 4 15-10-2001 22:35


All times are GMT -5. The time now is 04:19.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi