What is the RobotC type for motors?

I'm trying to create a function that allows me to more easily start a motor, but I'm running into a problem, I don't know the type to use for the motorName argument. I'm using a VEX 269 Motor. Here's the function.

void runMotor(MotorTypeHere motorName, int speed, int time)
{
startMotor(motorName, speed);
wait(time);
}


I just don't know what type to put for the motorName argument. What type would it be?

• I am pretty sure it is a string, try that. Apr 27 '15 at 16:43
• they are more likely just ints, with each of the ports defined in a header somewhere. Apr 28 '15 at 21:59

Looking at some of the docs I see that the startMotor function usually takes values like portN as in:

startMotor(port8,-32);
startMotor(port9,128);


and I am also seeing that some code looks like this:

motor[port8] = -32;
motor[port9] = 128;


so that tells me that since it is an index into an array it must be just simply an int.

Update: I can see on this page that within VEX it is actually a variable of type tMotor. But it can't work as an index in C unless tMotor is an alias for some sort of int. Ultimately, the best choice would be to use tMotor in your code.

• Have you confirmed this? Apr 28 '15 at 22:55
• I found more info from a page I found for the ROBOTC language and added it to my answer. Apr 29 '15 at 18:18