View Single Post
  #3   Spotlight this post!  
Unread 06-11-2003, 10:21
Sachiel7's Avatar
Sachiel7 Sachiel7 is offline
<Yes I managed to flip it
AKA: Shayne Helms
FRC #1132 (RAPTAR Robotics)
 
Join Date: Sep 2002
Rookie Year: 2002
Location: Richmond, VA
Posts: 541
Sachiel7 is just really niceSachiel7 is just really niceSachiel7 is just really niceSachiel7 is just really niceSachiel7 is just really nice
Send a message via AIM to Sachiel7
OK Here's how to pull it off:
The main File you want to edit is User_Routines.c, not User_Routines_Fast, or anything else(for the main loop).
Scroll down to the Process_Master_uP Function. This is the main loop. Start writing after the Get_tx command.

Since User_Routines.C executes every 17ms, One Second is equal to 58 cycles.
This is how I handle my autonomous code(sorta):

counter ++; //This makes the counter value increase by one every cycle

if (counter > 300)
{
Do_Function_2
else
Do_Function_1
}

Thats the Guts of it. I would browse the alias.h file, so you can see what variables are mapped to what inputs/outputs.
If you're having trouble with C, it's not TOO different from basic, once you get used to it. You can find some info on C here:

http://www.strath.ac.uk/IT/Docs/Ccourse/

Just scroll around and take a look.
I personally spent this past summer reading Sams latest "Learn C++ in 24 hours" book, and my dad's old Kernighan & Ritchie Books. I also keep the ol' Harbison & Steele C reference manual around for when things get funny.

I think I might post a sample auto program up in the white papers and link it here. I use a table-based method of control. An array holds movement data, with the time for each function to last. This can be adapted with extreme ease.
Anyway, hope this helped a little bit.
__________________
-=Sachiel7=-

There's no such thing as being too simple!
Look for Team #1132, RAPTAR Robotics at the VCU Regional this year!