Thread: Autonomous Help
View Single Post
  #3   Spotlight this post!  
Unread 16-12-2003, 00:46
rbayer's Avatar Unsung FIRST Hero
rbayer rbayer is offline
Blood, Sweat, and Code
no team (Teamless Orphan)
 
Join Date: Mar 2002
Rookie Year: 2001
Location: Minnetonka, MN
Posts: 1,087
rbayer is a glorious beacon of lightrbayer is a glorious beacon of lightrbayer is a glorious beacon of lightrbayer is a glorious beacon of lightrbayer is a glorious beacon of light
Send a message via AIM to rbayer
Re: Autonomous Help

These are complicated issues, and there's really no simple answer. I can tell you for sure that reading the specs on the PIC will be about as useful as reading those of the BS2sx (ie not very). Those datasheets are intended for use by people like InnovationFirst who do the actually embedded development. What you should read, however, is http://www.innovationfirst.com/FIRST...10-29-2003.pdf.

Pretty much all of your code should go where is says "Add your own code here" in user_routines.c. The Process_Data_From_Master_uP() function is called everytime the RC has new data, so you can think of it as being just like the old PBASIC code that was between the SERIN and SEROUT (if this analogy doesn't help, just ignore it). Once you're comfortable with that, you should look at the Process_Data_From_Local_IO() routine and see if it fits your purposes any better.

You probably won't be using any for/while loops to do the timing, but will instead be doing some small bit of work each time the Process_Data_From_Master_uP() function gets called, much like autonomous code from last year.

As for actual example code, I unfortunately don't have any. I can try to whip some up, but without an RC (my team no longer exists), I can't really try it out.

Keep asking questions, and chances are someone around here will be able to answer.
__________________
New C-based RoboEmu2 (code simulator) available at: http://www.robbayer.com/software.php