Motor Config

Can I move the #pragma section for the motors to another file?
If so, how is this done?
It just seems annoying to me that it takes up so much space.

Thanks.

Yes.

There are a couple of different ways.

Just cut and paste the config statements into another file and save in the same location as you program. For example, the following is in a file called setup.c


#pragma config(Motor,  port1,            ,             tmotorVex393_HBridge, openLoop)
#pragma config(Motor,  port2,            ,             tmotorVex393_MC29, openLoop)
//*!!Code automatically generated by 'ROBOTC' configuration wizard               !!*//

Then include that file in you program file like this, make sure it’s the top line.

#include "setup.c"

task main()
{
  while(1) wait1Msec(10);
}

The second way is a little more complicated, you can save the configuration as a standard model, it takes a bit longer to explain so I will do that tomorrow.