Use String as function parameter:

Ok, I know I have done this before. But how can I use a string in a function paramater? Just like on the first line, I want to have drive(FWD,255); and have it do that.

String CW, CCW, FWD, REV, STOP, setdir;
void drive(String dir, int howfast) //call with drive(FWD/REV/CW/CCW, 0-255) for direction and speed
{
if(dir == CW)
{
digitalWrite(leftDirPin, LOW);
digitalWrite(rightDirPin, HIGH);
analogWrite(leftSpeedPin, howfast);
analogWrite(rightSpeedPin, howfast);
gyroVoltage = 5.01; //this compensates for voltage drop to stop gyro drift
}
if(dir == CCW)
{
digitalWrite(leftDirPin, HIGH);
digitalWrite(rightDirPin, LOW);
analogWrite(leftSpeedPin, howfast);
analogWrite(rightSpeedPin, howfast);
gyroVoltage = 5.01;
}
if(dir.equals(FWD))
{
digitalWrite(leftDirPin, LOW);
digitalWrite(rightDirPin, LOW);
analogWrite(leftSpeedPin, howfast);
analogWrite(rightSpeedPin, howfast);
gyroVoltage = 5.01;
}
if(dir == REV)
{
digitalWrite(leftDirPin, LOW);
digitalWrite(rightDirPin, HIGH);
analogWrite(leftSpeedPin, howfast);
analogWrite(rightSpeedPin, howfast);
gyroVoltage = 5.01;
}
if(dir == STOP)
{
digitalWrite(leftDirPin, LOW);
digitalWrite(rightDirPin, LOW);
analogWrite(leftSpeedPin, 0);
analogWrite(rightSpeedPin, 0);
gyroVoltage = 5.00;
}
return;
}

so all I would do is have

#define FWD 0;
#define REV 1;
etc?

eovnu87435ds:
so all I would do is have

#define FWD 0;
#define REV 1;
etc?

No, that's not an enum (although it can be done that way).

http://www.enel.ucalgary.ca/People/Norman/enel315_winter1997/enum_types/

Do not terminate #define's with a semi-colon. It isn't required, and it just breaks the code where you use the defined value.