Whenever I assign variables (including competition_mode, autonomous_mode, pwm01, and pwm02), the variable values turn into 256x whatever I assigned.

For instance, if I give pwm01 the value 127, the value returned after I use a printf command is 32512. Here is my code in my Stop function (located in the User_Autonomous_Code function):
void Stop (int counter1) // Drive forward until counter reaches zero
{
while( counter1 > 0 )
{
counter1--;
pwm01 = 127;
printf("pwm01: %d\n", pwm01);
pwm02 = 127;
printf("pwm02: %d\n", pwm02);
printf("should be stopped \n");
printf("counter1: %d\n", counter1);
}
}
Anyone have a similar problem or know how to fix it?