Is it possible to have a function accept multiple parameters?

I want to have this function also control the power levels of the motors while it’s also passing in how many ticks the IMEs have to make before the while loop is exited. Here is my function:


int normalSpeed;
normalSpeed = 63;
int slowSpeed;
slowSpeed = 45;

void moveStraight(int encoderCount)
{
	nMotorEncoder[leftDriveMotor] = 0;
	nMotorEncoder[rightDriveMotor] = 0;

	while (-nMotorEncoder[leftDriveMotor] < encoderCount)
	{
		if (-nMotorEncoder[leftDriveMotor] > -nMotorEncoder[rightDriveMotor])
		{
			motor[leftDriveMotor] = slowSpeed;
			motor[rightDriveMotor] = normalSpeed;
		}
		else if (-nMotorEncoder[leftDriveMotor] < -nMotorEncoder[rightDriveMotor])
		{
			motor[leftDriveMotor] = normalSpeed;
			motor[rightDriveMotor] = slowSpeed;
		}
		else if (-nMotorEncoder[leftDriveMotor] == -nMotorEncoder[rightDriveMotor])
		{
			motor[rightDriveMotor] = normalSpeed;
			motor[leftDriveMotor] = normalSpeed;
		}
	}
}
...

Is it possible to declare a function like this:

void moveStraight(int encoderCount, int normalSpeed, int slowSpeed)
{
...
}

and thus call said function like this?


moveStraight(675, 63, 45)

Oh, in case you’re wondering why I have the negative sign in front of the nMotorEncoder, it’s because the encoders are counting backwards (because I have an idler gear connecting the wheels and the motor) when the wheels move forward.

Yes that’s possible, did you try it?