Arduino infrared problems

I am successfully getting the remote to output a value for each button I press; however, I need to use the output to change the output PWM voltage.

For example: The PWM command for motor control is:
int motor_input = # //the number being a value from 0-255

How do I get the IR output value to change the # in the motor input command?