|
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.
|