Quote:
|
Originally Posted by budgiekid
A question, though, if and when we start to write our own code for the Vex bots , what files should be included and left out so that the build is successful? Or is any code we write just going to be modifications of the default files already outlined?
|
I'd suggest first starting with the basic working version of the code you have now and trying modifications to it. Save working copies of the whole folder periodically, so you can easily fallback to a working version if some of your changes go terribly wrong.
If you plan on making major changes, then I'd suggest you create brand new files to put all your customized code in. Then just add those new files to your existing project. You can add whatever you want to a project, just be careful not to add two versions of the same file or routine.
For instance, we put all our autonomous code in it's own file, and we put sensor specific code in a separate file of it's own. It makes it so much easier to reuse our code in new projects when we can just include a file, such as, Line_Follower.c.
When you advance to the point where you're comfortable replacing everything with your own code, you basically need to keep or provide your own version of most (not all) of the functionality found in the files that begin with "ifi_". You need a main.c, but you can rewrite it to fit your needs. You'll also need bits and pieces from user_routines.c and user_routines_fast.c, such as, User_Initialization() and the InterruptHandlerLow(). Probably the easiest course to follow would be to first replace specific routines with your own versions. For instance, the most obvious routine to begin modifying is Default_Routine(). That's where you setup all your driving controls and responses. The next obvious routine to replace is User_Autonomous_Code().
One caution about replacing existing files. There are special files included by the code with a C statement such as:
Code:
#include "user_routines.h"
You'll see these "include" statements near the top of most c source files.
The compiler is going to go looking for a file by that exact name, in this example that would be "user_routines.h", regardless of what file name you may have used in the project list, so if you decided to replace the existing file by that name with one of your own devising and you call your's "my_user_routines.h" you'd better change all those include statements too, or the program will keep pulling in that old file even though it's not listed as part of your project.