View Single Post
  #3   Spotlight this post!  
Unread 28-01-2004, 18:07
deltacoder1020's Avatar
deltacoder1020 deltacoder1020 is offline
Computer Guy
AKA: Dav
#1020 (The Indiana Prank Monkeys)
Team Role: Programmer
 
Join Date: Jan 2004
Location: Muncie, Indiana
Posts: 340
deltacoder1020 has a spectacular aura aboutdeltacoder1020 has a spectacular aura about
Send a message via AIM to deltacoder1020
Re: Inserting Naviagation code into Default code?

If you have the "navigate" package for the IR sensors, you're almost good to go - both this code and the default code are based off the same template. Essentially what you'll need to do is take all of the manual control code from the default code (all of which is in user_routines.c), and merge it into the navigate code. Also, you'll have to change user_routines_fast.c in the navigate code so that it will only navigate when the robot is in autonomous mode. Functions to look at are as follows:

user_routines.c
void User_Initialization() - make sure everything is set up like it needs to be (assigning IO pins, et cetera)
void Process_Data_From_Master_uP() - add stuff from default to navigate
void Default_Routine() - this entire function needs to be copied from default to navigate

user_routines_fast.c
void Process_Data_From_Local_IO() - move the call to Navigate() into the while loop and if statement in User_Autonomous_Code()
void User_Autonomous_Code() - any other autonomous mode stuff can go here, along with the call to Navigate()

that should be just about it, if i've forgotten or not noticed anything, feel free to tell me.
__________________
Team 1020, the Indiana Prank Monkeys (www.team1020.org)